Re-brand ERROR_CFLAGS to C_ERROR_CFLAGS
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 8 Apr 2013 10:43:25 +0000 (11:43 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 12 Apr 2013 11:15:49 +0000 (12:15 +0100)
These are flags that we only use when compiling hand-written C code,
mostly originating from telepathy-glib. We can't be that strict with
the C code generated by Vala, because it's full of questionable things
(which the Vala compiler verifies are OK, but the C compiler still warns
about).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=697354
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip@tecnocode.co.uk>
backends/telepathy/lib/Makefile.am
configure.ac
tests/lib/telepathy/contactlist/Makefile.am

index 094916b..535d501 100644 (file)
@@ -33,7 +33,7 @@ tp_lowlevel_headers = tp-lowlevel.h
 libtp_lowlevel_la_CFLAGS = \
        $(AM_CFLAGS) \
        $(CODE_COVERAGE_CFLAGS) \
-       $(ERROR_CFLAGS) \
+       $(C_ERROR_CFLAGS) \
        $(GIO_CFLAGS) \
        $(GLIB_CFLAGS) \
        $(GEE_CFLAGS) \
index a7c4da0..b383c78 100644 (file)
@@ -436,7 +436,12 @@ IT_PROG_INTLTOOL([0.50.0])
 # but we need it for dbus-glib. Porting to GDBus will solve this (#653198)
 AC_DEFINE(GLIB_DISABLE_DEPRECATION_WARNINGS, 1, [Build with GLib deprecated])
 
-AS_COMPILER_FLAG([-Wall], [ERROR_CFLAGS="-Wall"], [ERROR_CFLAGS=""])
+# C_ERROR_CFLAGS are only used for C code from telepathy-glib for now,
+# while ERROR_CFLAGS are used for everything.
+
+ERROR_CFLAGS=
+
+AS_COMPILER_FLAG([-Wall], [C_ERROR_CFLAGS="-Wall"], [C_ERROR_CFLAGS=""])
 AS_COMPILER_FLAG([-Werror], [werror=yes], [werror=no])
 
 AC_ARG_ENABLE([debug],
@@ -484,7 +489,7 @@ m4_if(folks_released, [1], [],
             -a x$winit_self = xyes -a x$wformat = xyes -a \
             x$wmissing_include_dirs = xyes -a x$waggregate_return = xyes -a \
             x$wdeclaration_after_statement = xyes; then
-            ERROR_CFLAGS="$ERROR_CFLAGS -Wextra \
+            C_ERROR_CFLAGS="$C_ERROR_CFLAGS -Wextra \
                 -Wno-missing-field-initializers \
                 -Wno-unused-parameter ${flag}strict-prototypes \
                 ${flag}missing-prototypes ${flag}implicit-function-declaration \
@@ -494,17 +499,18 @@ m4_if(folks_released, [1], [],
         fi
     ])
 
-AS_COMPILER_FLAG([-D_POSIX_SOURCE], [ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE"])
-AS_COMPILER_FLAG([-std=c99], [ERROR_CFLAGS="$ERROR_CFLAGS -std=c99"])
-AS_COMPILER_FLAG([-Wshadow], [ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow"])
-AS_COMPILER_FLAG([-Wmissing-prototypes], [ERROR_CFLAGS="$ERROR_CFLAGS \
+AS_COMPILER_FLAG([-D_POSIX_SOURCE], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS -D_POSIX_SOURCE"])
+AS_COMPILER_FLAG([-std=c99], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS -std=c99"])
+AS_COMPILER_FLAG([-Wshadow], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS -Wshadow"])
+AS_COMPILER_FLAG([-Wmissing-prototypes], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS \
                                           -Wmissing-prototypes"])
-AS_COMPILER_FLAG([-Wmissing-declarations], [ERROR_CFLAGS="$ERROR_CFLAGS \
+AS_COMPILER_FLAG([-Wmissing-declarations], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS \
                                             -Wmissing-declarations"])
-AS_COMPILER_FLAG([-Wstrict-prototypes], [ERROR_CFLAGS="$ERROR_CFLAGS \
+AS_COMPILER_FLAG([-Wstrict-prototypes], [C_ERROR_CFLAGS="$C_ERROR_CFLAGS \
                                          -Wstrict-prototypes"])
 
 AC_SUBST([ERROR_CFLAGS])
+AC_SUBST([C_ERROR_CFLAGS])
 
 # -----------------------------------------------------------
 # Code coverage flags
index 1ddd7a3..7cb0cb6 100644 (file)
@@ -40,7 +40,7 @@ libtp_test_contactlist_la_SOURCES = \
        $(NULL)
 
 libtp_test_contactlist_la_CFLAGS = \
-       $(ERROR_CFLAGS) \
+       $(C_ERROR_CFLAGS) \
        $(TP_GLIB_CFLAGS) \
        $(DBUS_GLIB_CFLAGS) \
        $(NULL)