Message ID | 20191110100323.13206-1-a@unstable.cc |
---|---|
State | Accepted |
Headers | show |
Series | [Openvpn-devel] add -Wno-stringop-truncation to CFLAGS on linux | expand |
Acked-by: Gert Doering <gert@greenie.muc.de> While I'm not exactly happy suppressing warnings, this particular one is somewhat of an annoyance - the two cases where we cause warnings today are perfectly fine, and working around spurious compiler warnings is not what I want to spend our time on. We can revisit this later. Your patch has been applied to the master branch. commit 46d096074fd74e0d6c1d4756429215d22f2b3441 Author: Antonio Quartulli Date: Sun Nov 10 11:03:23 2019 +0100 add -Wno-stringop-truncation to CFLAGS on linux Signed-off-by: Antonio Quartulli <a@unstable.cc> Acked-by: Gert Doering <gert@greenie.muc.de> 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 <gert@greenie.muc.de> -- kind regards, Gert Doering
diff --git a/configure.ac b/configure.ac index 4159e450..807804e5 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])
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 <a@unstable.cc> --- configure.ac | 1 + 1 file changed, 1 insertion(+)