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.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2016-03-01 22:20:10 -08:00
parent ef63588eb4
commit 25da6eaf43
2 changed files with 7 additions and 1 deletions

3
aclocal.m4 vendored
View File

@ -9,7 +9,8 @@ AC_DEFUN(PA_ADD_CFLAGS,
CFLAGS="$CFLAGS $1" CFLAGS="$CFLAGS $1"
AC_TRY_LINK([#include <stdio.h>], AC_TRY_LINK([#include <stdio.h>],
[printf("Hello, World!\n");], [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]) AC_MSG_RESULT([no])
CFLAGS="$pa_add_cflags__old_cflags")]) CFLAGS="$pa_add_cflags__old_cflags")])

View File

@ -189,6 +189,11 @@ PA_ADD_CFLAGS([-W])
PA_ADD_CFLAGS([-Wall]) PA_ADD_CFLAGS([-Wall])
PA_ADD_CFLAGS([-std=c99]) PA_ADD_CFLAGS([-std=c99])
PA_ADD_CFLAGS([-pedantic]) 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])
PA_ADD_CFLAGS([-Wwrite-strings])
AC_ARG_ENABLE([werror], AC_ARG_ENABLE([werror],
[AC_HELP_STRING([--enable-werror], [AC_HELP_STRING([--enable-werror],
[compile with -Werror to error out on any warning])], [compile with -Werror to error out on any warning])],