summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-03-01 22:20:10 -0800
committerH. Peter Anvin <hpa@zytor.com>2016-03-04 11:14:35 -0800
commit52e8646d17b47c65b2c08010df22342efd07305b (patch)
treee6b9d968c387ceca326e156731d9e57901a39a75
parent409e2df1f26bbbe299c8cd5111fd17f03595be17 (diff)
downloadnasm-52e8646d17b47c65b2c08010df22342efd07305b.tar.gz
configure: enable additional code cleanliness warnings
We are supposed to handle compiling on a "C90 plus long long" compiler, so make gcc (our most common development platform compiler) complain when we don't. However, suppress the complaints about the Microsoft definitions of the <inttypes.h> strings. From master branch checkin 25da6eaf434705a6ad01f252132dc7f109493c67, except that -Wwrite-strings is omitted; making the code base -Wwrite-strings clean is going to take additional work. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--aclocal.m43
-rw-r--r--configure.in4
2 files changed, 6 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 89512787..50c1af88 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -9,7 +9,8 @@ AC_DEFUN(PA_ADD_CFLAGS,
CFLAGS="$CFLAGS $1"
AC_TRY_LINK([#include <stdio.h>],
[printf("Hello, World!\n");],
- AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([yes])
+ CFLAGS="$pa_add_cflags__old_cflags ifelse([$2],[],[$1],[$2])",
AC_MSG_RESULT([no])
CFLAGS="$pa_add_cflags__old_cflags")])
diff --git a/configure.in b/configure.in
index b7f7110a..cbaebc4a 100644
--- a/configure.in
+++ b/configure.in
@@ -183,6 +183,10 @@ AC_ARG_ENABLE([ccache],
[])
PA_ADD_CFLAGS([-pedantic])
+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])
AC_ARG_ENABLE([werror],
[AC_HELP_STRING([--enable-werror],
[compile with -Werror to error out on any warning])],