aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2018-12-12 15:56:28 -0800
committerH. Peter Anvin (Intel) <hpa@zytor.com>2018-12-12 15:56:28 -0800
commit64b56eaa3961038302ea3a8cc20d1f39c8d03c01 (patch)
tree0e18a4400519aa496d757b3429f1326986e4d849
parent77f53ba6d4cb90e5a7e09b33357ed7c1fe9f6b9d (diff)
downloadnasm-64b56eaa3961038302ea3a8cc20d1f39c8d03c01.tar.gz
nasm-64b56eaa3961038302ea3a8cc20d1f39c8d03c01.tar.xz
nasm-64b56eaa3961038302ea3a8cc20d1f39c8d03c01.zip
configure: add -Wno-shift-negative-value
Shifting negative values is undefined in standard C, but we have tons of dependencies that signed arithmetic is 2's-complement in the code anyway, and on gcc-like compilers we pass the -fwrapv option to indicate exactly that. Therefore, this is not a valid warning in our case and should be suppressed. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r--configure.ac5
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e707158c..38b3b596 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,6 +281,11 @@ 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 This is needed because we assume 2's-completement signed arithmetic;
+dnl on compilers with gcc-like command line syntax we pass the -fwrapv
+dnl option for exactly that reason.
+PA_ADD_CFLAGS([-Wshift-negative-value],[-Wno-shift-negative-value])
+
dnl PA_ADD_CFLAGS([-Wwrite-strings])
PA_ARG_ENABLED([werror],
[compile with -Werror to error out on any warning],