Skip to content

Commit 7923eac

Browse files
committed
add UBSAN to GCC (#378)
1 parent 387546c commit 7923eac

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
236236
message(STATUS "Building with GCC (${CMAKE_CXX_COMPILER})")
237237
if(MMAPPER_IS_DEBUG)
238238
if(NOT WIN32)
239-
message("-- Building with GCC address sanitizer")
239+
message(STATUS "-- Building with GCC address sanitizer")
240240
add_compile_options(-fsanitize=address)
241241
add_link_options(-fsanitize=address)
242+
243+
message(STATUS "Building with GCC undefined behavior sanitizer")
244+
add_compile_options(-fsanitize=undefined)
245+
add_link_options(-fsanitize=undefined)
242246
endif()
243247

244248
add_compile_options(-Waddress)

0 commit comments

Comments
 (0)