From 42f39c547b5a377cd80f749e0ec4a3ebd9664341 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Mon, 11 Mar 2013 10:59:13 -0700 Subject: [PATCH] Add -Wdeclaration-after-statement. We keep accidentally adding these which break the -pedantic build, so complain about it in the normal build. Also de-duplicate the warning list. --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 4af60283..55c63156 100644 --- a/configure.ac +++ b/configure.ac @@ -224,12 +224,13 @@ AC_SUBST(SYMBOL_VISIBILITY) CFLAGS="$CFLAGS -W" +warn_CFLAGS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wdeclaration-after-statement" saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes" -AC_MSG_CHECKING([if ${CC} supports -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes]) +CFLAGS="$CFLAGS $warn_CFLAGS" +AC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], [ AC_MSG_RESULT([yes]) - EXTRA_WARNS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes" ], + EXTRA_WARNS=$warn_CFLAGS ], AC_MSG_RESULT([no])) CFLAGS="$saved_CFLAGS $EXTRA_WARNS"