aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ovsienko <denis@ovsienko.info>2024-03-14 23:06:10 +0000
committerDenis Ovsienko <denis@ovsienko.info>2024-04-04 18:18:15 +0100
commitd89fed1067f1ab97041fb94df1f3935be1f5e7e7 (patch)
treec2842dd179123ebabd897b0bd75851460dd4d366
parent50a432cf9804892b9b2fa30ef97d1a8f90615e0a (diff)
downloadtcpdump-d89fed1067f1ab97041fb94df1f3935be1f5e7e7.tar.gz
Fix Sun C invocation from CMake.
cc: Can not use -xc99 with -pedantic (cherry picked from commit b29858253cb12894604b8cc479b23df3e484a889)
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac30eca8..a9ec0323 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1043,7 +1043,13 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
check_and_add_compiler_option(-Wmissing-prototypes)
check_and_add_compiler_option(-Wmissing-variable-declarations)
check_and_add_compiler_option(-Wold-style-definition)
- check_and_add_compiler_option(-Wpedantic)
+ if(NOT CMAKE_C_COMPILER_ID MATCHES "Sun")
+ # In Sun C versions that implement GCC compatibility "-Wpedantic"
+ # means the same as "-pedantic". The latter is mutually exclusive
+ # with several other options. One of those is "-xc99", which has
+ # already been set for Sun C above.
+ check_and_add_compiler_option(-Wpedantic)
+ endif()
check_and_add_compiler_option(-Wpointer-arith)
check_and_add_compiler_option(-Wpointer-sign)
check_and_add_compiler_option(-Wshadow)