Files
mercury/Documentation/README.sanitizers
2025-12-18 15:20:46 +11:00

18 lines
752 B
Plaintext

The configure option `--enable-sanitizers' will enable AddressSanitizer
and UndefinedBehaviorSanitizer when building with gcc. The built Mercury
compiler will also enable the same sanitizers when building user programs.
AddressSanitizer and UndefinedBehaviorSanitizer are included in gcc 4.9
and above. We have tested with gcc 5.3.0.
Only high-level C grades work with the sanitizers enabled.
For best results, use a `.target_debug' grade or otherwise enable C debugging.
clang does not work yet (tested version 3.8.0). It seemingly does not
terminate when compiling certain files with UndefinedBehaviorSanitizer,
e.g. runtime/mercury_deconstruct.c. There are also linking issues to be
sorted out.
See also: <https://github.com/google/sanitizers>