]> source.dussan.org Git - rspamd.git/commitdiff
Add new warnings supported by gcc-6
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 16 Feb 2016 13:44:25 +0000 (13:44 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 16 Feb 2016 13:44:25 +0000 (13:44 +0000)
CMakeLists.txt

index 170a1c5415072aa687d80e473288a98c47f52ca5..f8ae533eb9984aa17905bcb43c4bd1990b2c2937 100644 (file)
@@ -710,6 +710,10 @@ CHECK_C_COMPILER_FLAG(-Wunused-variable SUPPORT_WUNUSED_VAR)
 CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN)
 CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES)
 CHECK_C_COMPILER_FLAG(-pedantic SUPPORT_PEDANTIC_FLAG)
+# GCC 6 specific
+CHECK_C_COMPILER_FLAG(-Wnull-dereference SUPPORT_WNULL_DEREFERENCE)
+CHECK_C_COMPILER_FLAG(-Wduplicated-cond SUPPORT_WDUPLICATED_COND)
+CHECK_C_COMPILER_FLAG(-Wlogical-op SUPPORT_WLOGICAL_OP)
 IF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro)
        CHECK_C_COMPILER_FLAG("-std=c11" SUPPORT_STD11_FLAG)
        CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD99_FLAG)
@@ -741,6 +745,15 @@ ENDIF(SUPPORT_WSTRICT_PROTOTYPES)
 IF(SUPPORT_PEDANTIC_FLAG)
        SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -pedantic")
 ENDIF(SUPPORT_PEDANTIC_FLAG)
+IF(SUPPORT_WNULL_DEREFERENCE)
+       SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wnull-dereference")
+ENDIF()
+IF(SUPPORT_WDUPLICATED_COND)
+       SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wduplicated-cond")
+ENDIF()
+IF(SUPPORT_WLOGICAL_OP)
+       SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wlogical-op")
+ENDIF()
 IF(SUPPORT_STD11_FLAG)
        SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -std=c11")
 ELSE(SUPPORT_STD11_FLAG)