From facd05570f9d26fd859580e40a3f2eb12987f5ba Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Thu, 8 Nov 2018 17:09:47 +0000 Subject: [PATCH] Disable -Wstringop-truncation. We use strncpy in very limited ways, one of which is for struct sockaddr_un, for which strncpy truncation is correct. --- src/microcode/configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/microcode/configure.ac b/src/microcode/configure.ac index 77ed4747d..1c4babf26 100644 --- a/src/microcode/configure.ac +++ b/src/microcode/configure.ac @@ -231,6 +231,8 @@ if test ${GCC} = yes; then -Wuninitialized \ -Wunreachable-code \ -Wwrite-strings \ + \ + -Wno-error=stringop-truncation \ ; do AC_MSG_CHECKING([for compiler warning $flag]) SAVED_CFLAGS="$CFLAGS" @@ -243,6 +245,8 @@ if test ${GCC} = yes; then # other possibilities: # -Wmissing-prototypes (requires prototypes for DEFINE_PRIMITIVE) + # -Wstringop-truncation (requires it to not whine about correct use + # of strncpy for buffers that are _not_ null-terminated) fi FOO=`${INSTALL} --help 2> /dev/null | ${FGREP} -e --preserve-timestamps` if test "x${FOO}" != x; then -- 2.25.1