summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-11-22 04:18:08 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-11-22 04:22:33 +0300
commit96a8fd9b3b0ce90c6bed6cb94cd2904cb7a12d2c (patch)
treec2c2243c0f67b80e1671d48bbfd94315223b42a6
parent8c34424b3a10eef507655b3304297d96ad71f804 (diff)
downloadlibatomic_ops-96a8fd9b3b0ce90c6bed6cb94cd2904cb7a12d2c.tar.gz
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.
-rw-r--r--configure.ac10
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 9c011a9..055167a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,7 +55,15 @@ 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([],[], [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"
AC_ARG_ENABLE(werror, [AC_HELP_STRING([--enable-werror],
[Pass -Werror to the C compiler])])