[giggle] build: Use the gnulib manywarnings macros
- From: Javier JardÃn <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [giggle] build: Use the gnulib manywarnings macros
- Date: Mon, 2 Apr 2012 13:52:02 +0000 (UTC)
commit 8b04eef185503e79fc00919b3a6335b879dc1272
Author: Javier JardÃn <jjardon gnome org>
Date: Mon Apr 2 14:08:13 2012 +0100
build: Use the gnulib manywarnings macros
configure.ac | 49 ++++++++++++++++----------------------------
libgiggle-git/Makefile.am | 2 +-
libgiggle/Makefile.am | 2 +-
plugins/Makefile.am | 2 +-
src/Makefile.am | 2 +-
5 files changed, 22 insertions(+), 35 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 53f78be..f1c2b39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -200,37 +200,24 @@ dnl ---------------------------------------------------------------------------
dnl - Extra verbose warning switches
dnl ---------------------------------------------------------------------------
-if test "$GCC" = "yes"; then
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wall"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align -Wno-uninitialized"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-declarations"
-# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wredundant-decls"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wpointer-arith"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wcast-align"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wwrite-strings"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Winit-self"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wreturn-type"
-# WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-nonliteral"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wformat-security"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-include-dirs"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-format-attribute"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wclobbered"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wempty-body"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wignored-qualifiers"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wsign-compare"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wtype-limits"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wuninitialized"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Waggregate-return"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wdeclaration-after-statement"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wshadow"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wno-strict-aliasing"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Winline"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Wmissing-parameter-type"
- WARNINGFLAGS_C="$WARNINGFLAGS_C -Woverride-init"
-else
- WARNINGFLAGS_C=""
-fi
-AC_SUBST(WARNINGFLAGS_C)
+gl_MANYWARN_ALL_GCC([warnings])
+# Set up the list of the pointless, undesired warnings.
+nw=
+nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
+nw="$nw -Wundef" # All compiler preprocessors support #if UNDEF
+nw="$nw -Wtraditional" # All compilers nowadays support ANSI C
+nw="$nw -Wtraditional-conversion"
+nw="$nw -Wpadded" # Happy for compiler to add struct padding
+nw="$nw -Wconversion" # These warnings usually don't point to mistakes.
+nw="$nw -Wsign-conversion" # Likewise.
+nw="$nw -Wc++-compat" # Don't care about C++ compiler compat
+nw="$nw -Wunused-parameter" # Unused parameters are fine
+
+# Enable all GCC warnings not in this list.
+gl_MANYWARN_COMPLEMENT([warnings], [$warnings], [$nw])
+for w in $warnings; do
+ gl_WARN_ADD([$w])
+done
dnl -----------------------------------------------------------
diff --git a/libgiggle-git/Makefile.am b/libgiggle-git/Makefile.am
index 2cb50be..bb64927 100644
--- a/libgiggle-git/Makefile.am
+++ b/libgiggle-git/Makefile.am
@@ -6,7 +6,7 @@ AM_CPPFLAGS = \
$(GIGGLE_CFLAGS)
AM_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
lib_LTLIBRARIES = libgiggle-git.la
diff --git a/libgiggle/Makefile.am b/libgiggle/Makefile.am
index 684266c..0b04aa4 100644
--- a/libgiggle/Makefile.am
+++ b/libgiggle/Makefile.am
@@ -7,7 +7,7 @@ AM_CPPFLAGS = \
$(GIGGLE_CFLAGS)
AM_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
lib_LTLIBRARIES = libgiggle.la
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index d26e2da..ae09bda 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -7,7 +7,7 @@ AM_CPPFLAGS = \
$(GIGGLE_CFLAGS)
AM_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
AM_LDFLAGS = \
-module -rpath "$(plugindir)" \
diff --git a/src/Makefile.am b/src/Makefile.am
index d6c7e54..dbbf4fb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,7 +6,7 @@ AM_CPPFLAGS = \
$(GIGGLE_CFLAGS)
AM_CFLAGS = \
- $(WARNINGFLAGS_C)
+ $(WARN_CFLAGS)
AM_LDFLAGS = \
-Wl,--export-dynamic -rpath '$(libdir)'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]