aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-06-02 23:46:21 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-06-02 23:47:57 -0700
commitc4e16f7e7c1492f34ba4544d435e387fa2d97cd7 (patch)
tree4f87d92ccf9630a6f265837e01409e8b9df91155
parent3cb9068ee07fe15d4085f70110be31b6443f97ed (diff)
downloadnasm-c4e16f7e7c1492f34ba4544d435e387fa2d97cd7.tar.gz
nasm-c4e16f7e7c1492f34ba4544d435e387fa2d97cd7.tar.xz
nasm-c4e16f7e7c1492f34ba4544d435e387fa2d97cd7.zip
gcc: newer gcc trip on -Wstringop-truncation for valid uses of strncpy()
strncpy() is correctly used to fill in a zero-*padded* (not zero-terminated) field in several places. Make gcc not complain about those uses. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--configure.ac3
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ff2d91df..e707158c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -278,6 +278,9 @@ dnl Suppress format warning on Windows targets due to their <inttypes.h>
PA_ADD_CFLAGS([-Wpedantic-ms-format],[-Wno-pedantic-ms-format])
PA_ADD_CFLAGS([-Wc90-c99-compat])
PA_ADD_CFLAGS([-Wlong-long],[-Wno-long-long])
+dnl This is needed because we intentionally expect strncpy() to fill
+dnl in a zero-padded (not zero-terminated) buffer in several backends
+PA_ADD_CFLAGS([-Wstringop-truncation],[-Wno-stringop-truncation])
dnl PA_ADD_CFLAGS([-Wwrite-strings])
PA_ARG_ENABLED([werror],
[compile with -Werror to error out on any warning],