diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-03-24 18:22:28 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-03-25 00:49:30 +0000 |
commit | 0035e9d9ddd530c9e7998de40a1b6c3daa8b7068 (patch) | |
tree | eb5fef0c0553b3fc5d1c2873afa5068cb34d8cb3 /configure.ac | |
parent | 4440da9cae829ef76badd5b2fc8a273fcd79298e (diff) | |
download | wireshark-0035e9d9ddd530c9e7998de40a1b6c3daa8b7068.tar.gz |
autotools: Reorder extra compiler warnings to come last
Also try to improve check hf description.
Change-Id: I7a1e5997dfc7a97cc62e2f2f9cc7c5026468451e
Reviewed-on: https://code.wireshark.org/review/14623
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 201 |
1 files changed, 100 insertions, 101 deletions
diff --git a/configure.ac b/configure.ac index a3249d8d4d..49e450f2ef 100644 --- a/configure.ac +++ b/configure.ac @@ -865,107 +865,6 @@ AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR # -# Try to add some additional checks to CFLAGS. -# These are not enabled by default, because the warnings they produce -# are very hard or impossible to eliminate. -# -AC_ARG_ENABLE(extra-compiler-warnings, - AC_HELP_STRING( [--enable-extra-compiler-warnings], - [do additional compiler warnings @<:@default=no@:>@]), -[ - wireshark_extra_flags=$enableval - if test $enableval != no - then - # - # The following are for C and C++ - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic) - # - # As we use variadic macros, we don't want warnings - # about them, even with -Wpedantic. - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros) - # - # Various code blocks this one. - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Woverflow) - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4) - # - # Due to various places where APIs we don't control - # require us to cast away constness, we can probably - # never enable this one with -Werror. - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual) - # - # Some generated ASN.1 dissectors block this one; - # multiple function declarations for the same - # function are being generated. - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls) - # - # Some loops are safe, but it's hard to convince the - # compiler of that. - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations) - # - # All the registration functions block these for now. - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes) - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations) - # - # A bunch of "that might not work on SPARC" code blocks - # this one for now. - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align) - # - # Works only with Clang - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code) - # - # Works only with Clang but generates a lot of warnings - # (about glib library not using Doxygen) - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation) - - # - # The following are C only, not C++ - # - # Due to various places where APIs we don't control - # require us to cast away constness, we can probably - # never enable this one with -Werror. - # - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C) - fi -],) - -# Try to add ASAN address analyze. -# Only needed for analyse -# -AC_ARG_ENABLE(asan, - AC_HELP_STRING( [--enable-asan], - [Enable AddressSanitizer (ASAN) for debugging (May be slow down)@<:@default=no@:>@]), -[ - # - # With Clang >= 3.5 Leak detection is enable by default - # and no yet all leak is fixed... - # use ASAN_OPTIONS=detect_leaks=0 to disable detect_leaks - # - # XXX shouldn't this also be added to LDFLAGS? - AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address) - -],) - - -# Add check hf conflict.. -# -AC_ARG_ENABLE(checkhf-conflict, - AC_HELP_STRING( [--enable-checkhf-conflict], - [Enable Check hf conflict for debugging (May be slow start)@<:@default=no@:>@]), -[ - AC_DEFINE(ENABLE_CHECK_FILTER, 1, [Enable check hf conflict]) -],) - -# # The following are for C and C++ # AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall) @@ -1107,6 +1006,106 @@ then fi fi +# +# Try to add some additional checks to CFLAGS. +# These are not enabled by default, because the warnings they produce +# are very hard or impossible to eliminate. +# +AC_ARG_ENABLE(extra-compiler-warnings, + AC_HELP_STRING( [--enable-extra-compiler-warnings], + [do additional compiler warnings @<:@default=no@:>@]), +[ + wireshark_extra_flags=$enableval + if test $enableval != no + then + # + # The following are for C and C++ + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic) + # + # As we use variadic macros, we don't want warnings + # about them, even with -Wpedantic. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros) + # + # Various code blocks this one. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Woverflow) + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4) + # + # Due to various places where APIs we don't control + # require us to cast away constness, we can probably + # never enable this one with -Werror. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual) + # + # Some generated ASN.1 dissectors block this one; + # multiple function declarations for the same + # function are being generated. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls) + # + # Some loops are safe, but it's hard to convince the + # compiler of that. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations) + # + # All the registration functions block these for now. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes) + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations) + # + # A bunch of "that might not work on SPARC" code blocks + # this one for now. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align) + # + # Works only with Clang + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code) + # + # Works only with Clang but generates a lot of warnings + # (about glib library not using Doxygen) + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation) + + # + # The following are C only, not C++ + # + # Due to various places where APIs we don't control + # require us to cast away constness, we can probably + # never enable this one with -Werror. + # + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C) + fi +]) + +# Try to add ASAN address analyze. +# Only needed for analyse +# +AC_ARG_ENABLE(asan, + AC_HELP_STRING( [--enable-asan], + [Enable AddressSanitizer (ASAN) for debugging (degrades performance)@<:@default=no@:>@]), +[ + # + # With Clang >= 3.5 Leak detection is enable by default + # and no yet all leak is fixed... + # use ASAN_OPTIONS=detect_leaks=0 to disable detect_leaks + # + # XXX shouldn't this also be added to LDFLAGS? + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address) + +]) + +# Add check hf conflict.. +# +AC_ARG_ENABLE(checkhf-conflict, + AC_HELP_STRING( [--enable-checkhf-conflict], + [Enable hf conflict check for debugging (start-up may be slower)@<:@default=no@:>@]), +[ + AC_DEFINE(ENABLE_CHECK_FILTER, 1, [Enable hf conflict check]) +]) + AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed]) ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,-M]) ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--cref]) |