Mini examples to illustrate the use of Clang
and GCC
sanitizers
To run Address Sanitizers examples with CMake
:
$ cd asan
$ mkdir build
$ cd build
$ cmake ..
$ make -j
$ ctest
To disable configuration with sanitizers modify the step above:
$ cmake -DENABLE_ASAN=OFF ..
To enable other sanitizers (e.g. TSAN):
$ cmake -DENABLE_TSAN=ON ..
To see verbose information modify the step above:
$ ctest -VV
$ cd asan
$ mkdir build
$ cd build
$ meson -Db_sanitize=address ..
$ ninja
$ ninja test