Example code demonstrating categories of errors detected by gcc/clang sanitizers
$ ./buildAll.sh
# Override compilers
$ CC=/path/to/clang CXX=/path/to/clang++ ./buildAll.sh
Code examples taken from:
- https://github.com/google/sanitizers/wiki/AddressSanitizer
- https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer
- https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
- https://github.com/google/sanitizers/wiki/MemorySanitizer
- https://developers.redhat.com/blog/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan
CMake support for sanitizer builds: