summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2019-08-16 00:52:26 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2019-08-16 00:52:26 -0700
commit480d5e2c8bb8b0678d23d0e2af51202dbb5cb589 (patch)
treef59f984b4344086ebd37cfb34763faebcd10e40c
parent5bb35772b3008805ba7a212d19098cead9abf1d4 (diff)
downloadnasm-480d5e2c8bb8b0678d23d0e2af51202dbb5cb589.tar.gz
BR 3392601: allow the user to disable pedantic warnings
--disable-pedantic passed to configure will now disable -W, -Wc90-c99-compat, and -pedantic. Requested-by: Orzkan Sezer <sezeroz@gmail.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r--configure.ac9
1 files changed, 6 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 9f3f9d5f..1a750b27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -277,16 +277,19 @@ dnl
PA_ADD_CFLAGS([-fvisibility=hidden])
dnl If we have gcc, add appropriate code cleanliness options
-PA_ADD_CFLAGS([-W])
PA_ADD_CFLAGS([-Wall])
-PA_ADD_CFLAGS([-pedantic])
+PA_ARG_DISABLED([pedantic],
+[disable some extra paranoid compiler warnings],
+[],
+[PA_ADD_CFLAGS([-W])
+ PA_ADD_CFLAGS([-pedantic])
+ PA_ADD_CFLAGS([-Wc90-c99-compat])])
dnl LLVM doesn't error out on invalid -W options unless this option is
dnl specified first. Enable this so this script can actually discover
dnl which -W options are possible for this compiler.
PA_ADD_CFLAGS([-Werror=unknown-warning-option])
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