Compiler Help
The compiler builds the ASan and UBSan features into the executables. An environment variable optionally controls these features.
ASan
Address Sanitizer (ASan) is a memory error detector for C/C++.
Description:
When you enable the ASan feature, the compiler adds code to the program to implement address
sanitization. You can then build the binary with the -fsanitize=address
option (refer to
Compiler defenses
). Finally, the program relies on the libasan.so
library, which links automatically, for the target-dependent functionality.
The ASAN_OPTIONS environment variable passes most of the runtime flags to the Address Sanitizer. For more information on the runtime flags, refer to Runtime flags.
For more information on the Address Sanitizer flags, refer to Address Sanitizer.
UBSan
Undefined Behavior Sanitizer (UBSan) is a fast undefined-behavior-detector.
Description:
UBSan modifies the program at compile time to catch undefined behavior during the execution of a program. For details about current checks, refer to Ubsan-checks.
To suppress the UBSan error reports for specific files, functions, or libraries, without recompiling the code, pass its path in a UBSAN_OPTIONS environment variable.
When you use the qcc option to compile and link the program with the -fsanitize=undefined flag, the executable links with the proper UBSan runtime library (libubsan.so).