From 30da2bfe0e86c25462e92cf4e2284265848fa756 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Tue, 11 May 2010 22:44:12 +0000 Subject: sugar-artwork: stricter compiler flags 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 Reviewed-by: James Cameron Tested-by: James Cameron --- diff --git a/configure.ac b/configure.ac index f32dd32..c9f5c26 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 subtle 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` -- cgit v0.9.1