aboutsummaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2011-04-20 09:16:44 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2011-04-20 09:16:44 +0000
commitec6ad6f31113c55648eef0f4619a8820aeee44fe (patch)
tree011bc93f704b9ab15d847d1290b0f74b4029c887 /acinclude.m4
parentaaa2afdae25573c41f50b095c54e2977f7911f84 (diff)
By default, clang only warns about unknown -W options, it doesn't
generate an error for them. Force them to be treated as errors, so we correctly test whether an option is supported. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36732 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m49
1 files changed, 9 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index f296be9e47..2ef985fe73 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1724,12 +1724,21 @@ fi
# We do this because not all such options are necessarily supported by
# the version of the particular compiler we're using.
#
+# NOTE: clang, by default, only warns about unknown -W options.
+# If we're using clang, we turn on -Werror=unknown-warning-option
+# so that it fails if we pass it a -W option it doesn't know about
+# but doesn't fail for any other warning that the test program might
+# produce.
+#
AC_DEFUN([AC_WIRESHARK_GCC_CFLAGS_CHECK],
[GCC_OPTION="$1"
AC_MSG_CHECKING(whether we can add $GCC_OPTION to CFLAGS)
if test "x$ac_supports_gcc_flags" = "xyes" ; then
CFLAGS_saved="$CFLAGS"
CFLAGS="$CFLAGS $GCC_OPTION"
+ if test "x$CC" = "xclang" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([[
int foo;