aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-03-14 09:56:31 -0700
committerGuy Harris <guy@alum.mit.edu>2016-03-14 16:59:17 +0000
commitec075789e31942008eb8ad7faf35b7012778dac8 (patch)
tree0a6f8691f5d3998ec17ba377100f6886850a6877 /configure.ac
parent4aa049019a4504e07e9cc4cc5fa6079bd8aa24e6 (diff)
Try to suppress a compiler feature that goes wrong.
-Warray-bounds + the macros for strcmp() = pain. Either the macro is doing something wrong or the compiler is confused, because if( strcmp(argv[i],"--")==0 ) dashdash = 1; should not produce array index 3 is past the end of the array (which contains 3 elements) Either 1) the macro is blithely running past the end of "--", which does, indeed, contain only 3 elements, or 2) the compiler mistakenly believes that the code generated by the macro is running past the end of "--" when it isn't. Change-Id: I4183e29272ba9e05b3b370efd90102f2226df7c3 Reviewed-on: https://code.wireshark.org/review/14469 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e9beccbb5b..75b14578d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -993,6 +993,22 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable)
#
+# Either the version of clang on the "clang code analysis" buildbot is
+# horribly broken, or the header files on that buildbot are horribly
+# broken, as the perfectly-legitimate statement
+#
+# if( strcmp(argv[i],"--")==0 ) dashdash = 1;
+#
+# is getting stoopid "array index 3 is past the end of the array (which
+# contains 3 elements)" complaints from the compiler.
+#
+# The macro for strcmp() in glibc(?) really seems to give C compilers
+# conniptions; I think I've seen crap from GCC as well with that macro.
+#
+# So, alas, suppress the compile-time array bounds checks.
+#
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wnoarray-bounds)
+#
# The following are C only, not C++
#
AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wc++-compat, C)