From: Ivan Maidanski Date: Tue, 22 Nov 2016 12:18:36 +0000 (+0300) Subject: Report gcc/clang pedantic warnings (configure) X-Git-Tag: v7.6.2~311 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ce0d776b40978e838c39258292d25766a557a57;p=gc Report gcc/clang pedantic warnings (configure) * configure.ac [GCC] (WPEDANTIC): New variable (set to "-Wpedantic -Wno-long-long" if supported by the compiler). * configure.ac [GCC] (CFLAGS): Add $WPEDANTIC. --- diff --git a/configure.ac b/configure.ac index 73da0c98..1c4e2a4a 100644 --- a/configure.ac +++ b/configure.ac @@ -407,7 +407,17 @@ if test "$GCC" = yes; then CFLAGS="$old_CFLAGS" AC_MSG_RESULT($ac_cv_cc_wextra) AS_IF([test "$ac_cv_cc_wextra" = yes], [WEXTRA="-Wextra"], [WEXTRA="-W"]) - CFLAGS="-Wall $WEXTRA $CFLAGS" + AC_MSG_CHECKING(for gcc -Wpedantic) + CFLAGS="-Wpedantic -Wno-long-long $CFLAGS" + AC_TRY_COMPILE([],[ + extern int quiet; + ], [ac_cv_cc_pedantic=yes], [ac_cv_cc_pedantic=no]) + CFLAGS="$old_CFLAGS" + AC_MSG_RESULT($ac_cv_cc_pedantic) + WPEDANTIC= + AS_IF([test "$ac_cv_cc_pedantic" = yes], + [WPEDANTIC="-Wpedantic -Wno-long-long"]) + CFLAGS="-Wall $WEXTRA $WPEDANTIC $CFLAGS" fi AC_MSG_CHECKING(for xlc)