diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-17 16:05:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-17 16:05:43 +0000 |
commit | a9be4161d7a4225d3a45fee7bf42023bd3c772a8 (patch) | |
tree | 35a89fd970b9c0d05124b1edcfd70bc00dd69c66 /cmake | |
parent | 06baaa8ff24f1b74b4962e1f71cddf3946b92c2a (diff) | |
parent | 25d8df0b735c6b966b05cc3ce4a8f69cf20b199f (diff) | |
download | rspamd-a9be4161d7a4225d3a45fee7bf42023bd3c772a8.tar.gz rspamd-a9be4161d7a4225d3a45fee7bf42023bd3c772a8.zip |
Merge pull request #3220 from cgzones/compiler_warnings
[Minor] Fix some compiler warnings
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CompilerWarnings.cmake | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index a9797f539..4dd011d98 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -1,5 +1,5 @@ CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL) -CHECK_C_COMPILER_FLAG(-W SUPPORT_W) +CHECK_C_COMPILER_FLAG(-Wextra SUPPORT_WEXTRA) CHECK_C_COMPILER_FLAG(-Wpointer-arith SUPPORT_WPOINTER) CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WPARAM) CHECK_C_COMPILER_FLAG(-Wno-unused-function SUPPORT_WFUNCTION) @@ -16,9 +16,9 @@ CHECK_C_COMPILER_FLAG(-Wduplicated-cond SUPPORT_WDUPLICATED_COND) # GCC 7 specific CHECK_C_COMPILER_FLAG(-Wimplicit-fallthrough SUPPORT_WIMPLICIT_FALLTHROUGH) -IF(SUPPORT_W) - ADD_COMPILE_OPTIONS("-W") -ENDIF(SUPPORT_W) +IF(SUPPORT_WEXTRA) + ADD_COMPILE_OPTIONS("-Wextra") +ENDIF(SUPPORT_WEXTRA) IF(SUPPORT_WALL) ADD_COMPILE_OPTIONS("-Wall") ENDIF(SUPPORT_WALL) @@ -35,10 +35,12 @@ IF(SUPPORT_WUNUSED_VAR) ADD_COMPILE_OPTIONS("-Wunused-variable") ENDIF(SUPPORT_WUNUSED_VAR) IF(SUPPORT_WPOINTER_SIGN) - ADD_COMPILE_OPTIONS("-Wno-pointer-sign") + # only valid for C + ADD_COMPILE_OPTIONS($<$<COMPILE_LANGUAGE:C>:-Wno-pointer-sign>) ENDIF(SUPPORT_WPOINTER_SIGN) IF(SUPPORT_WSTRICT_PROTOTYPES) - ADD_COMPILE_OPTIONS("-Wstrict-prototypes") + # only valid for C + ADD_COMPILE_OPTIONS($<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes>) ENDIF(SUPPORT_WSTRICT_PROTOTYPES) IF(SUPPORT_WSTRICT_ALIASING) ADD_COMPILE_OPTIONS("-Wno-strict-aliasing") @@ -69,4 +71,4 @@ ENDIF(SUPPORT_WIMPLICIT_FALLTHROUGH) CHECK_C_COMPILER_FLAG(-fPIC SUPPORT_FPIC) IF(SUPPORT_FPIC) ADD_COMPILE_OPTIONS("-fPIC") -ENDIF(SUPPORT_FPIC)
\ No newline at end of file +ENDIF(SUPPORT_FPIC) |