From: "Lukáš Karas" <lukas.karas@centrum.cz>
To: connman@lists.linux.dev
Subject: [PATCH] dnsproxy: Suppress GCC warning stringop-overflow
Date: Tue, 15 Jun 2021 09:40:36 +0200 [thread overview]
Message-ID: <2664831.oeSPPojSJB@latitudemachine> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 409 bytes --]
Hi all.
Recently added check for buffer size breaks build
with GCC 10.3.0, its internal analysis suspect that code
is not correct. Build fails with error:
'__builtin_strncpy' specified bound depends on the length
of the source argument [-Werror=stringop-overflow=]
on src/dnsproxy.c:1794
I not sure if suppressing compiler warning is a good practice
in Connman, but it fixes build for me :-)
Lukas
[-- Attachment #1.2: 0001-dnsproxy-Suppress-GCC-warning-stringop-overflow.patch --]
[-- Type: text/x-patch, Size: 1083 bytes --]
From 3c605b7c2798ba5cb3ae8afdadc31f68337228b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Karas?= <lukas.karas@centrum.cz>
Date: Tue, 15 Jun 2021 09:23:39 +0200
Subject: [PATCH] dnsproxy: Suppress GCC warning stringop-overflow
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Recently added check for buffer size breaks build
with GCC 10.3.0, its internal analysis suspect that code
is not correct. Build fails with error:
'__builtin_strncpy' specified bound depends on the length
of the source argument [-Werror=stringop-overflow=]
on src/dnsproxy.c:1794
Signed-off-by: Lukáš Karas <lukas.karas@centrum.cz>
---
src/dnsproxy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index 38dbdd71..035593e9 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -41,6 +41,8 @@
#include "connman.h"
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+
#define debug(fmt...) do { } while (0)
#if __BYTE_ORDER == __LITTLE_ENDIAN
--
2.27.0
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2021-06-15 7:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-15 7:40 Lukáš Karas [this message]
2021-06-15 9:15 ` [PATCH] dnsproxy: Suppress GCC warning stringop-overflow Santtu Lakkala
2021-06-15 9:51 VAUTRIN Emmanuel (Canal Plus Prestataire)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2664831.oeSPPojSJB@latitudemachine \
--to=lukas.karas@centrum.cz \
--cc=connman@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).