aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-10-17 05:42:40 +0200
committerSven Gothel <[email protected]>2020-10-17 05:42:40 +0200
commitffb44f29e24b4b1e9505a29c16e848bc7f3e46a5 (patch)
tree01fb21dd62614e94422fd806fd9559e9174b8056 /CMakeLists.txt
parent009f15e0ff4f8e91962e6dd45f7d610aa195b8c0 (diff)
GCC: Add -Wcast-align=strict and cleanup -Wformat flags, also add DEBUG -fsanitize-address-use-after-scope
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9182e4a3..fb4c649e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,12 +10,13 @@ PKG_CHECK_MODULES (GIO-UNIX REQUIRED gio-unix-2.0>=2.40)
# for all
set (CC_FLAGS_WARNING "-Wall -Wextra -Werror")
-set (GCC_FLAGS_WARNING "-Wall -Wextra -Wformat=2 -Wformat-overflow=2 -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k -Wnull-dereference -Winit-self -Werror")
+set (GCC_FLAGS_WARNING_FORMAT "-Wformat=2 -Wformat-overflow=2 -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k")
+set (GCC_FLAGS_WARNING "-Wall -Wextra -Wcast-align=strict -Wnull-dereference -Winit-self ${GCC_FLAGS_WARNING_FORMAT} -Werror")
# debug only
set (GCC_FLAGS_STACK "-fstack-protector-strong -fstack-check")
-# set (GCC_FLAGS_SANITIZE "-fsanitize=undefined -fsanitize=thread")
-set (GCC_FLAGS_SANITIZE "-fsanitize=address -fsanitize-address-use-after-scope -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fsanitize=leak")
+# set (GCC_FLAGS_SANITIZE "-fsanitize-address-use-after-scope -fsanitize=undefined -fsanitize=thread")
+set (GCC_FLAGS_SANITIZE "-fsanitize-address-use-after-scope -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fsanitize=leak")
# -fsanitize=address cannot be combined with -fsanitize=thread
# -fsanitize=pointer-compare -fsanitize=pointer-subtract must be combined with -fsanitize=address
# -fsanitize=thread TSAN's lacks ability to properly handle GCC's atomic macros (like helgrind etc), can't check SC-DRF!