summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2019-10-27 16:25:44 +0100
committerMurray Cumming <murrayc@murrayc.com>2019-10-27 16:32:49 +0100
commit6813065f5f2305d6cba308678b64a434945be055 (patch)
tree0603bb3c71d39b8d4acab9efc51a4f157c6f3c79
parent051d1cab888a55d3565024041f32ba046f0fb3e3 (diff)
downloadsigc++-undefined-behavior-sanitizer.tar.gz
wip: Use undefined-behavior sanitizerundefined-behavior-sanitizer
In theory, this should cause failures when the tests run (make check) if there are problems. Ideally, we could enable this only for some builds in the CI.
-rw-r--r--CMakeLists.txt2
-rw-r--r--configure.ac2
2 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e7f383..d3b3a0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,7 @@ endif()
# Add compiler warning flags & turn warnings into errors
add_compile_options(
"$<$<OR:$<CXX_COMPILER_ID:MSVC>,$<C_COMPILER_ID:MSVC>>:/W4;/WX>"
- "$<$<OR:$<CXX_COMPILER_ID:GNU>,$<C_COMPILER_ID:GNU>>:-pedantic;-Wall;-Wextra;-Wsuggest-override;-Wshadow;-Wzero-as-null-pointer-constant;-Wformat-security>"
+ "$<$<OR:$<CXX_COMPILER_ID:GNU>,$<C_COMPILER_ID:GNU>>:-pedantic;-Wall;-Wextra;-Wsuggest-override;-Wshadow;-Wzero-as-null-pointer-constant;-Wformat-security -fsanitize=undefined>"
"$<$<OR:$<CXX_COMPILER_ID:Clang>,$<C_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<C_COMPILER_ID:AppleClang>>:-pedantic;-Wall;-Wextra;-Wshadow;-Wzero-as-null-pointer-constant;-Wformat-security>"
)
diff --git a/configure.ac b/configure.ac
index d88205f..4a7483d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,7 @@ AS_IF([test "x$config_error" = xyes],
# Evaluate the --enable-warnings=level option.
MM_ARG_ENABLE_WARNINGS([SIGC_WXXFLAGS],
[-Wall],
- [-pedantic -Wall -Wextra -Wsuggest-override -Wshadow -Wzero-as-null-pointer-constant -Wformat-security])
+ [-pedantic -Wall -Wextra -Wsuggest-override -Wshadow -Wzero-as-null-pointer-constant -Wformat-security -fsanitize=undefined])
# Offer the ability to omit some API from the library.
MM_ARG_DISABLE_DEPRECATED_API([SIGCXX])