diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-09-11 14:10:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-09-11 21:11:21 +0000 |
commit | 87887802ef05490a64e1f9b7eb8f219506042ea2 (patch) | |
tree | 7abde45d26bbff0c0f1c723c685da649bbe3fd2b | |
parent | 7533398f6545c2730a2fd1a5c8c3630cd64e516d (diff) |
Put the -Wno-error= options after -Werror.
It appears that -Werror overrides them, at least with llvm-gcc; I guess
the options are evaluated in order.
Change-Id: I0fd9e544a8e191a8950e17e97513912034763645
Reviewed-on: https://code.wireshark.org/review/29615
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | CMakeLists.txt | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd663f5d5d..57e8a96bd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,25 +495,6 @@ else() # ! MSVC ) # - # Apple's llvm-gcc appears not to support suppressing warnings with - # pragmas, so, if we're building on a Mac (we check for APPLE), - # and we're not using Clang, we suppress errors for some warnings - # that we can only remove by suppressing them, as they're in - # generated code. - # - # Unfortunately, -Wno-error=unused-function, perhaps because - # it's enabled by -Wall, not by -Wunused-function, so we just - # say "don't report this". - # - if (APPLE AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang") - list(APPEND WIRESHARK_COMMON_FLAGS - -Wno-error=comma - -Wno-error=shorten-64-to-32 - -Wno-unused-function - ) - endif() - - # # Code that may be worth looking into (coding practices) # if((NOT ENABLE_ASAN) AND (NOT ENABLE_TSAN) AND (NOT ENABLE_UBSAN) AND (NOT DISABLE_FRAME_LARGER_THAN_WARNING)) @@ -755,6 +736,26 @@ if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS) if (WERROR) set(WERROR_COMMON_FLAGS "-Werror") endif() + + # + # Apple's llvm-gcc appears not to support suppressing + # warnings with pragmas, so, if we're building on a Mac + # (we check for APPLE), and we're not using Clang, we + # suppress errors for some warnings that we can only + # remove by suppressing them, as they're in generated + # code. + # + # We have to do this *after* -Werror, otherwise the + # compiler decides -Werror means "never mind, make 'em + # all errors. + # + if (APPLE AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang") + list(APPEND WIRESHARK_COMMON_FLAGS + -Wno-error=comma + -Wno-error=shorten-64-to-32 + -Wno-error=unused-function + ) + endif() endif() endif() |