Skip to content

Instantly share code, notes, and snippets.

View rhythmize's full-sized avatar

Rhythm Chopra rhythmize

  • Microsoft
  • Prague, Czech Republic
View GitHub Profile
@jlblancoc
jlblancoc / gist:44be9d4d466f0a973b1f3808a8e56782
Last active October 22, 2024 07:40
GCC sanitizer with CMake

For memory leaks

Build in CMake with these params:

CMAKE_CXX_FLAGS:STRING= -fsanitize=address  -fsanitize=leak -g
CMAKE_C_FLAGS:STRING=-fsanitize=address  -fsanitize=leak -g
CMAKE_EXE_LINKER_FLAGS:STRING=-fsanitize=address  -fsanitize=leak
CMAKE_MODULE_LINKER_FLAGS:STRING=-fsanitize=address  -fsanitize=leak

Which can be done with: