From 6813065f5f2305d6cba308678b64a434945be055 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Sun, 27 Oct 2019 16:25:44 +0100 Subject: wip: Use undefined-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. --- CMakeLists.txt | 2 +- configure.ac | 2 +- 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( "$<$,$>:/W4;/WX>" - "$<$,$>:-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>" "$<$,$,$,$>:-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]) -- cgit v1.2.1