diff options
author | Andreas Schneider <asn@samba.org> | 2014-08-28 15:22:35 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2014-09-01 09:48:08 +0200 |
commit | 6637a810c7548bcea3fdaa88d4ffe2ed612bcf7a (patch) | |
tree | 2ebefb82f060f34b00796a7a4c60c1e5d03cb52a /cmake | |
parent | c83b7d4096ece0ca536c3028e59efc29eb438feb (diff) | |
download | socket_wrapper-6637a810c7548bcea3fdaa88d4ffe2ed612bcf7a.tar.gz socket_wrapper-6637a810c7548bcea3fdaa88d4ffe2ed612bcf7a.tar.xz socket_wrapper-6637a810c7548bcea3fdaa88d4ffe2ed612bcf7a.zip |
cmake: Set strict aliasing and strict overflow checks.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/DefineCompilerFlags.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/Modules/DefineCompilerFlags.cmake b/cmake/Modules/DefineCompilerFlags.cmake index 4a747d2..53481c3 100644 --- a/cmake/Modules/DefineCompilerFlags.cmake +++ b/cmake/Modules/DefineCompilerFlags.cmake @@ -15,10 +15,14 @@ if (UNIX AND NOT WIN32) 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 -Wcast-align -Wcast-qual") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers") 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 -Werror=write-strings") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast") + # -Werror=strict-aliasing is broken + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstrict-aliasing -Wstrict-aliasing=2") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstrict-overflow -Wstrict-overflow=5 -Werror=strict-overflow") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") if (OSX) |