build: Enable gcc warnings to detect non-portable code.
authorWerner Koch <wk@gnupg.org>
Mon, 2 Jan 2017 11:59:10 +0000 (12:59 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 2 Jan 2017 11:59:36 +0000 (12:59 +0100)
--

Signed-off-by: Werner Koch <wk@gnupg.org>
configure.ac

index 80d977c..fa206c9 100644 (file)
@@ -1574,6 +1574,15 @@ if test "$GCC" = yes; then
         if test x"$_gcc_wopt" = xyes ; then
           mycflags="$mycflags -Wdeclaration-after-statement"
         fi
+
+        AC_MSG_CHECKING([if gcc supports -Wlogical-op and -Wvla])
+        CFLAGS="-Wlogical-op -Wvla"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
+        AC_MSG_RESULT($_gcc_wopt)
+        if test x"$_gcc_wopt" = xyes ; then
+          mycflags="$mycflags -Wlogical-op -Wvla"
+        fi
+
     else
         mycflags="$mycflags -Wall"
     fi