CMake: Cleanup some compiler flags

Enable -Qunused-arguments because it may be a useful warning.
Remove -fwrapv because it is implied by -fno-strict-overflow.

Move GCC-specific flag out of if(GCC) condition. Let CMake enable
it automatically.
This commit is contained in:
João Valverde 2022-11-17 09:50:36 +00:00
parent 5754fdf289
commit 973748f321
1 changed files with 1 additions and 14 deletions

View File

@ -616,19 +616,6 @@ else() # ! MSVC
endif()
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
# avoid "argument unused during compilation" warnings
# (for example, when getting the -gsplit-dwarf option or
# when combining -fwrapv with -fno-strict-overflow)
-Qunused-arguments
)
else()
set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
-fexcess-precision=fast
)
endif()
list(APPEND WIRESHARK_COMMON_FLAGS
# The following are for C and C++
# -O<X> and -g get set by the CMAKE_BUILD_TYPE
@ -636,8 +623,8 @@ else() # ! MSVC
-Wextra
-Wpointer-arith
-Wformat-security
-fwrapv
-fno-strict-overflow
-fexcess-precision=fast # GCC-only
-Wvla
-Wattributes
-Wpragmas # Clang-only