[refs/tags/telepathy-idle-0.2.1] telepathy-idle: fix compilation on GCC 9.x, add #pragma
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Oct 31 23:01:25 UTC 2020
Module: telepathy-idle
Branch: refs/tags/telepathy-idle-0.2.1
Commit: 07d021e5e1c11e9ecda0907038bb7a6fa7f18c58
URL: http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=07d021e5e1c11e9ecda0907038bb7a6fa7f18c58
Author: David Heidelberg <david at ixit.cz>
Date: Sun Oct 27 17:25:35 2019 +0100
fix compilation on GCC 9.x, add #pragma
Fixes:
In function 'strncpy',
inlined from 'idle_server_connection_send_async' at idle-server-connection.c:593:2:
/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 512 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: David Heidelberg <david at ixit.cz>
---
src/idle-server-connection.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c
index 878b199..c463fe0 100644
--- a/src/idle-server-connection.c
+++ b/src/idle-server-connection.c
@@ -590,7 +590,10 @@ void idle_server_connection_send_async(IdleServerConnection *conn, const gchar *
* with null bytes gives us cleaner debug messages, without
* affecting the readability of the code.
*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(priv->output_buffer, cmd, output_buffer_size);
+#pragma GCC diagnostic pop
priv->nwritten = 0;
More information about the telepathy-commits
mailing list