summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac23
2 files changed, 27 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0849aac4..4fdac6cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2008-10-16 Tommi Komulainen <tommi.komulainen@iki.fi>
+ * configure.ac: enable bunch of gcc warning CFLAGS
+
+2008-10-16 Tommi Komulainen <tommi.komulainen@iki.fi>
+
Bug 556543 – reduce compiler warnings
* girepository/ginfo.c:
diff --git a/configure.ac b/configure.ac
index 230ab2e8..5202bdcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,29 @@ if test "$YACC" = :; then
AC_MSG_ERROR([bison not found but required])
fi
+changequote(,)dnl
+ensureflag() {
+ flag="$1"; shift
+ result="$@"
+
+ case " ${result} " in
+ *[\ \ ]${flag}[\ \ ]*) ;;
+ *) result="${flag} ${result}" ;;
+ esac
+
+ echo ${result}
+}
+changequote([,])dnl
+
+if test "$GCC" = "yes"; then
+ for flag in -Wall -Wchar-subscripts -Wmissing-declarations \
+ -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align \
+ -Wsign-compare -fno-strict-aliasing;
+ do
+ CFLAGS="$(ensureflag $flag $CFLAGS)"
+ done
+fi
+
# Checks for libraries.
GI_ENABLE_GCOV