aboutsummaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-20 09:16:44 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-20 09:16:44 +0000
commitf4ed7e89276882309a0e0d88688ca410e260e881 (patch)
tree011bc93f704b9ab15d847d1290b0f74b4029c887 /acinclude.m4
parentb9d4c025d148a3da297920cb0b3accaa0305d807 (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. svn path=/trunk/; revision=36732
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;