summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-08-05 13:55:48 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-21 11:56:28 +0100
commitcc5404cfa6487e095b1b401f3389a3c6174c10d3 (patch)
treec0eec61e81a93c261080c5ff333c5c642c564b20 /configure.ac
parent0db406cb192f6036094b4c5269e8c43e5c87ba93 (diff)
downloaddbus-cc5404cfa6487e095b1b401f3389a3c6174c10d3.tar.gz
Enable more compiler warnings by default
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 21 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index f8b26d70..d6e7cd8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,6 +249,7 @@ fi
if test x$enable_asserts = xno; then
AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
+ DISABLE_UNUSED_WARNINGS="unused-label"
R_DYNAMIC_LDFLAG=""
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
@@ -266,6 +267,7 @@ AC_SUBST(R_DYNAMIC_LDFLAG)
if test x$enable_checks = xno; then
AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
+ DISABLE_UNUSED_WARNINGS="unused-label"
fi
if test x$enable_userdb_cache = xyes; then
@@ -1233,8 +1235,9 @@ TP_COMPILER_WARNINGS([WARNING_CFLAGS],
dnl Override with --enable-Werror or --disable-Werror
[test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$USE_MAINTAINER_MODE = xyes],
- dnl enable these warnings if possible:
+ dnl Enable these warnings if possible:
[all \
+ extra \
char-subscripts \
missing-declarations \
missing-prototypes \
@@ -1246,12 +1249,25 @@ TP_COMPILER_WARNINGS([WARNING_CFLAGS],
declaration-after-statement \
],
- dnl disable these warnings if possible, make them non-fatal if possible,
- dnl and don't enable -Werror unless we succeeded:
- dnl (unused is by design, sign-compare and pointer-sign are fd.o #17433)
- [unused \
+ dnl Disable these warnings if possible, make them non-fatal if possible,
+ dnl and don't enable -Werror unless we succeeded.
+ dnl
+ dnl Intentional:
+ dnl - $DISABLE_UNUSED_WARNINGS disables unused-label warnings if not
+ dnl checking or not asserting
+ dnl - missing field initializers being 0 is a C feature, not a bug
+ dnl - unused-parameter is to make writing callbacks less annoying
+ dnl
+ dnl To be fixed one day:
+ dnl - sign-compare and pointer-sign are workarounds for fd.o #17433
+ dnl - type-limits is probably a bug too, but having the rest of -Wextra
+ dnl is better than nothing
+ [$DISABLE_UNUSED_WARNINGS \
+ missing-field-initializers \
+ unused-parameter \
sign-compare \
pointer-sign \
+ type-limits \
])
if test "x$GCC" = "xyes"; then