aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-05-23 08:50:47 +0200
committerMichael Adam <obnox@samba.org>2014-05-26 09:58:18 +0200
commitf60415a3ae411454551adc494e65fff7412e270e (patch)
tree1b78a216e2e924a55ec195f518902a9d58370905 /cmake
parent54d74cb22eb17107bdc8c36c24c43a1f2d16914e (diff)
downloadsocket_wrapper-f60415a3ae411454551adc494e65fff7412e270e.tar.gz
socket_wrapper-f60415a3ae411454551adc494e65fff7412e270e.tar.xz
socket_wrapper-f60415a3ae411454551adc494e65fff7412e270e.zip
cmake: Add some warnings were we should error out.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/DefineCompilerFlags.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/Modules/DefineCompilerFlags.cmake b/cmake/Modules/DefineCompilerFlags.cmake
index e522a6a..e6fab88 100644
--- a/cmake/Modules/DefineCompilerFlags.cmake
+++ b/cmake/Modules/DefineCompilerFlags.cmake
@@ -11,10 +11,14 @@ if (UNIX AND NOT WIN32)
# add -Wconversion ?
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=pointer-arith -Werror=declaration-after-statement")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration")
+
# with -fPIC
check_c_compiler_flag("-fPIC" WITH_FPIC)
if (WITH_FPIC)
@@ -33,6 +37,8 @@ if (UNIX AND NOT WIN32)
if (WITH_FORTIFY_SOURCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wp,-D_FORTIFY_SOURCE=2")
endif (WITH_FORTIFY_SOURCE)
+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=uninitialized")
endif()
endif()
endif (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")