From eb40b5a550da5968f14691865296838bc469b61d Mon Sep 17 00:00:00 2001 From: derselbst Date: Wed, 10 Jul 2019 17:01:12 +0200 Subject: [PATCH] Compile with address sanitizer on request --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76da64b2..6859920f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,9 +198,9 @@ if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_ set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wbad-function-cast -Wcast-align" ) if ( enable-ubsan ) - set ( CMAKE_C_FLAGS "-fsanitize=undefined ${CMAKE_C_FLAGS}" ) - set ( CMAKE_EXE_LINKER_FLAGS "-fsanitize=undefined ${CMAKE_EXE_LINKER_FLAGS}" ) - set ( CMAKE_SHARED_LINKER_FLAGS "-fsanitize=undefined ${CMAKE_SHARED_LINKER_FLAGS}" ) + set ( CMAKE_C_FLAGS "-fsanitize=address,undefined ${CMAKE_C_FLAGS}" ) + set ( CMAKE_EXE_LINKER_FLAGS "-fsanitize=address,undefined ${CMAKE_EXE_LINKER_FLAGS}" ) + set ( CMAKE_SHARED_LINKER_FLAGS "-fsanitize=address,undefined ${CMAKE_SHARED_LINKER_FLAGS}" ) set ( ENABLE_UBSAN 1 ) endif ( enable-ubsan ) endif (CMAKE_C_COMPILER_ID STREQUAL "Intel" )