[glib-networking] configure: turn some warnings into errors



commit b88517914f255cd8e032fec2d8f5feccd5ceb830
Author: Dan Winship <danw gnome org>
Date:   Fri Oct 21 15:21:49 2011 -0400

    configure: turn some warnings into errors
    
    Use -Werror=... to turn warnings into errors for warnings that occur
    in completely well-defined situations (ie, won't change with gcc
    versions or optimization levels) and that couldn't be triggered by
    foreign #include files.

 configure.ac |   47 ++++++++++++++++++-----------------------------
 1 files changed, 18 insertions(+), 29 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 38d3114..6d2125e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,35 +124,6 @@ if test "x$with_gnutls" = "xyes"; then
     fi
 fi
 
-dnl *************************************
-dnl *** Warnings to show if using GCC ***
-dnl *************************************
-
-AC_ARG_ENABLE(more-warnings,
-	      AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
-	      set_more_warnings=no)
-
-if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-	CFLAGS="$CFLAGS \
-		-Wall -Wstrict-prototypes -Wmissing-declarations \
-		-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
-		-Wdeclaration-after-statement -Wformat=2 -Winit-self \
-		-Waggregate-return -Wmissing-format-attribute"
-
-	for option in -Wmissing-include-dirs -Wundef; 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])
-		AC_MSG_RESULT($has_option)
-		if test $has_option = no; then
-			CFLAGS="$SAVE_CFLAGS"
-		fi
-	done
-fi
-
 dnl ************************************
 dnl *** Enable lcov coverage reports ***
 dnl ************************************
@@ -211,6 +182,24 @@ if test "x$use_gcov" = "xyes"; then
   LDFLAGS="$LDFLAGS -lgcov"
 fi
 
+dnl ****************************************************
+dnl *** Warnings to show if using GCC                ***
+dnl *** (do this last so -Werror won't mess up tests ***
+dnl ****************************************************
+
+AC_ARG_ENABLE(more-warnings,
+	      AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
+	      set_more_warnings=no)
+
+if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
+	CFLAGS="$CFLAGS \
+		-Wall -Wstrict-prototypes -Werror=missing-prototypes \
+		-Werror=implicit-function-declaration \
+		-Werror=pointer-arith -Werror=init-self -Werror=format=2 \
+		-Werror=missing-include-dirs -Werror=aggregate-return \
+		-Werror=declaration-after-statement"
+fi
+
 dnl *****************************
 dnl *** done                  ***
 dnl *****************************



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]