Skip to content

Commit

Permalink
Enable UB checks not enabled by -fsanitize=undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Dec 30, 2024
1 parent 2eaa3b7 commit 2739570
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ else()
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
endif()
if(SANITIZERS)
set(SAN_FLAGS -fsanitize=address -fsanitize=undefined)
set(SAN_FLAGS -fsanitize=address -fsanitize=undefined
-fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize=nullability)
add_compile_options(${SAN_FLAGS})
add_link_options(${SAN_FLAGS})
add_definitions(-D_GLIBCXX_ASSERTIONS)
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ develop:
-Wformat=2 -Wformat-overflow=2 -Wformat-truncation=1 \
-Wno-format-nonliteral -Wno-strict-overflow -Wno-unused-but-set-variable \
-Wno-type-limits -Wno-tautological-constant-out-of-range-compare -Wvla \
-D_GLIBCXX_ASSERTIONS -fsanitize=address -fsanitize=undefined" \
-D_GLIBCXX_ASSERTIONS -fsanitize=address -fsanitize=undefined \
-fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize=nullability" \
CXXFLAGS="-ggdb3 -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls"

# This target is used during development in order to more easily debug with gdb.
Expand Down

0 comments on commit 2739570

Please sign in to comment.