From e1cbfda259d2bfd2a87cda3519fd2cd69e509556 Mon Sep 17 00:00:00 2001 From: infirit Date: Fri, 21 Nov 2014 17:18:30 +0100 Subject: activate compiler warnings Based on FR commit: 1ceb60e36079e1337aed053b62d327bc2e89fafc From: Paolo Bacchilega --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 4aa833e..96ecc2a 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,26 @@ AC_SUBST([GTK_LIBS]) dnl =========================================================================== +WARN_CFLAGS="-Wall -Wcast-align -Wtype-limits -Wclobbered -Wempty-body -Wignored-qualifiers" + +for option in $WARN_CFLAGS; do + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $option" + AC_MSG_CHECKING([whether gcc understands $option]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[has_option=yes],[has_option=no]) + if test x$has_option = xyes; then + WARNINGS="$WARNINGS $option" + fi + AC_MSG_RESULT($has_option) + CFLAGS="$SAVE_CFLAGS" + unset has_option + unset SAVE_CFLAGS +done +unset option +CFLAGS="$CFLAGS $WARNINGS" + +dnl =========================================================================== + AC_ARG_ENABLE(run_in_place, AS_HELP_STRING([--enable-run-in-place], [load ui data and extensions from the source tree]),, -- cgit v1.2.1