Clang integrated AddressSanitizer since 3.1 version. We can use it directly by adding some compiler flags for Clang.
Something like this:
clang -fsanitize=address -O1 -fno-omit-frame-pointer -g tests.cpp
With CMake projection, however, we need to add the flag in your make file.
The simplest thing would be to add the following in your make file:
set(CMAKE_CXX_FLAGS "-fsanitize=address -O1 -fno-omit-frame-pointer -g")
No comments:
Post a Comment