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>
This commit is contained in:
Guy Harris 2016-03-14 09:56:31 -07:00
parent 4aa049019a
commit ec075789e3
1 changed files with 16 additions and 0 deletions

View File

@ -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)