Codebase list telepathy-glib / 27a1090
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> Will Thompson 13 years ago
1 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2121 for tp_flag in $4; do
2222 TP_COMPILER_FLAG([-Wno-$tp_flag],
2323 [tp_warnings="$tp_warnings -Wno-$tp_flag"])
24 dnl Yes, we do need to use both -Wno-foo and -Wno-error=foo. Simon says:
25 dnl some warnings we explicitly don't want, like unused-parameter, but
26 dnl they're in -Wall. when a distro using cdbs compiles us, we have:
27 dnl -Werror -Wno-unused-parameter -Wall
28 dnl ^ from us ^ from cdbs
29 dnl which turns -Wunused-parameter back on, in effect
2430 TP_COMPILER_FLAG([-Wno-error=$tp_flag],
2531 [tp_error_flags="$tp_error_flags -Wno-error=$tp_flag"], [tp_werror=no])
2632 done
3137 tp_werror=$enableval, :)
3238
3339 if test "x$tp_werror" = xyes && $2; then
34 $1="$tp_warnings $tp_error_flags"
40 dnl We put -Wno-error=foo before -Wno-foo because clang interprets -Wall
41 dnl -Werror -Wno-foo -Wno-error=foo as “make foo a non-fatal warning”, but does
42 dnl what we want if you reverse them.
43 $1="$tp_error_flags $tp_warnings"
3544 else
3645 $1="$tp_warnings"
3746 fi