From: Antonio Quartulli
Date: Sun, 10 Nov 2019 10:03:23 +0000 (+0100)
Subject: add -Wno-stringop-truncation to CFLAGS on linux
X-Git-Tag: v2.5_beta1~244
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46d096074fd74e0d6c1d4756429215d22f2b3441;p=thirdparty%2Fopenvpn.git
add -Wno-stringop-truncation to CFLAGS on linux
GCC>=8 supports truncation checking, however the logic is somewhat
fragile when it comes to evaluating strncpy().
In buffer.h we have implemented a wrapper called strncpynt() which
ensures we always do the right hting in the code and reduce the chance
of having bugs.
This said, it seems that the gcc logic is not able to always understand
if we are doing the right thing and throws a false positive.
Toa void the noise, disable truncation checking on Linux by default.
Signed-off-by: Antonio Quartulli
Acked-by: Gert Doering
Message-Id: <20191110100323.13206-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19085.html
Signed-off-by: Gert Doering
---
diff --git a/configure.ac b/configure.ac
index 4159e4509..807804e5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1283,6 +1283,7 @@ AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [
[AC_MSG_RESULT([no]); CFLAGS="$old_cflags"])]
)
+ACL_CHECK_ADD_COMPILE_FLAGS([-Wno-stringop-truncation])
ACL_CHECK_ADD_COMPILE_FLAGS([-Wno-unused-function])
ACL_CHECK_ADD_COMPILE_FLAGS([-Wno-unused-parameter])
ACL_CHECK_ADD_COMPILE_FLAGS([-Wall])