summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-02-07 16:06:23 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-02-07 16:14:12 +0100
commit27a1090a2a8c19aa7e25e85f86a7e372439dd259 (patch)
tree2c4ebecd0a372af1a4a86894aebfc62c821eced8 /m4
parent40290b2ff576773340289b988c4948d661df73ca (diff)
downloadtelepathy-glib-27a1090a2a8c19aa7e25e85f86a7e372439dd259.tar.gz
Put -Wno-error=foo before -Wno-foo
Clang treats the combination of these two parameters differently depending on which order they appear in. By reversing them, we can compile with `clang --analyze` and get warnings from its static analyzer without clutter. Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'm4')
-rw-r--r--m4/tp-compiler-warnings.m411
1 files changed, 10 insertions, 1 deletions
diff --git a/m4/tp-compiler-warnings.m4 b/m4/tp-compiler-warnings.m4
index fab5dc898..ee4af3101 100644
--- a/m4/tp-compiler-warnings.m4
+++ b/m4/tp-compiler-warnings.m4
@@ -22,6 +22,12 @@ AC_DEFUN([TP_COMPILER_WARNINGS],
for tp_flag in $4; do
TP_COMPILER_FLAG([-Wno-$tp_flag],
[tp_warnings="$tp_warnings -Wno-$tp_flag"])
+dnl Yes, we do need to use both -Wno-foo and -Wno-error=foo. Simon says:
+dnl some warnings we explicitly don't want, like unused-parameter, but
+dnl they're in -Wall. when a distro using cdbs compiles us, we have:
+dnl -Werror -Wno-unused-parameter -Wall
+dnl ^ from us ^ from cdbs
+dnl which turns -Wunused-parameter back on, in effect
TP_COMPILER_FLAG([-Wno-error=$tp_flag],
[tp_error_flags="$tp_error_flags -Wno-error=$tp_flag"], [tp_werror=no])
done
@@ -32,7 +38,10 @@ AC_DEFUN([TP_COMPILER_WARNINGS],
tp_werror=$enableval, :)
if test "x$tp_werror" = xyes && $2; then
- $1="$tp_warnings $tp_error_flags"
+dnl We put -Wno-error=foo before -Wno-foo because clang interprets -Wall
+dnl -Werror -Wno-foo -Wno-error=foo as “make foo a non-fatal warning”, but does
+dnl what we want if you reverse them.
+ $1="$tp_error_flags $tp_warnings"
else
$1="$tp_warnings"
fi