[Sugar-devel] [PATCH] sugar-artwork: stricter compiler flags

Bernie Innocenti bernie at codewiz.org
Tue May 11 18:56:14 EDT 2010


WARN_CFLAGS was already used in gtk/engine/Makefile.am, but not
initialized by configure.

For backwards compatibility, GCC's by default is very permissive.
In my case, it was silently miscompiling code which was calling
a non-existent GTK function. For this particular case, the
proposed WARN_CFLAGS should make the build fail early in this case.

I'm not proposing -Werror because it frequetly results in broken
builds for trivial reasons when distros update the toolchain.

Signed-off-by: Bernie Innocenti <bernie at codewiz.org>
---
 configure.ac |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index f32dd32..65e93ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,10 @@ AM_DISABLE_STATIC
 
 PKG_PROG_PKG_CONFIG([0.19])
 
+dnl These catch plenty of sublte bugs and miscompilation problems
+WARN_CFLAGS="-Wall -W -Werror=implicit-function-declaration"
+AC_SUBST(WARN_CFLAGS)
+
 AC_PROG_CC
 AC_HEADER_STDC
 AC_PROG_LIBTOOL
@@ -21,7 +25,7 @@ if test -z "$ICON_SLICER"; then
 fi
 
 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.0,,
-	          AC_MSG_ERROR([GTK+-2.0 is required to compile redhat-artwork]))
+	          AC_MSG_ERROR([GTK+-2.0 is required to compile sugar-artwork]))
 
 GDK_PIXBUF2_CFLAGS=`$PKG_CONFIG --cflags gdk-pixbuf-2.0`
 GDK_PIXBUF2_LIBS=`$PKG_CONFIG --libs gdk-pixbuf-2.0`
-- 
1.6.6.1



More information about the Sugar-devel mailing list