From 438b5ef9aed1e45abe1a28053584b0cd9c45cf32 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 30 Dec 2024 10:33:35 -0500 Subject: [PATCH] Use `-fsanitize=leak` and `-fsanitize=undefined` --- CMakeLists.txt | 4 ++-- Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0025fd501..2468f2fd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,8 +45,8 @@ else() add_compile_options(-Wno-gnu-zero-variadic-macro-arguments) endif() if(SANITIZERS) - set(SAN_FLAGS -fsanitize=shift -fsanitize=integer-divide-by-zero - -fsanitize=unreachable -fsanitize=vla-bound + set(SAN_FLAGS -fsanitize=shift -fsanitize=integer-divide-by-zero -fsanitize=leak + -fsanitize=undefined -fsanitize=unreachable -fsanitize=vla-bound -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=object-size -fsanitize=bool -fsanitize=enum -fsanitize=alignment -fsanitize=null -fsanitize=address) diff --git a/Makefile b/Makefile index 8f52ef433..4ab4a6cf2 100644 --- a/Makefile +++ b/Makefile @@ -207,8 +207,8 @@ develop: -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=shift -fsanitize=integer-divide-by-zero \ - -fsanitize=unreachable -fsanitize=vla-bound \ + -fsanitize=shift -fsanitize=integer-divide-by-zero -fsanitize=leak \ + -fsanitize=undefined -fsanitize=unreachable -fsanitize=vla-bound \ -fsanitize=signed-integer-overflow -fsanitize=bounds \ -fsanitize=object-size -fsanitize=bool -fsanitize=enum \ -fsanitize=alignment -fsanitize=null -fsanitize=address" \