diff --git a/docs/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.md b/docs/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.md index a9e6c0e1..b2ee3c58 100644 --- a/docs/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.md +++ b/docs/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.md @@ -1304,9 +1304,11 @@ LSan cannot be used simultaneously with AddressSanitizer (ASan) or ThreadSanitiz ### UndefinedBehaviorSanitizer -| Compiler Flag | Supported since | Description | -|:---------------------- |:---------------------:|:--------------------------------------------------------------------------- | -| `-fsanitize=undefined`
(requires `-O1` or higher) | GCC 4.9.0
Clang 3.3.0 | Enables UndefinedBehaviorSanitizer to detect undefined behavior at run time | +| Compiler Flag | Supported since | Description | +|:------------------------------------------------------------------------- |:-------------------------:|:--------------------------------------------------------------------------------------------------------------------------------- | +| `-fsanitize=undefined` | GCC 4.9.0
Clang 3.3.0 | Enables UndefinedBehaviorSanitizer to detect undefined behavior at run time. Requires `-O1` or higher. | +| `-fsanitize-minimal-runtime` | Clang 6.0.0 | Enables minimal UBSan runtime rather than Clang's usual libubsan library for using UBSan in production code. | +| `-fsanitize-trap=undefined` | GCC 13.1.0 | Enables UBSan with reporting through `__builtin_trap` rather than GCC's usual libubsan runtime library. Requires `-O1` or higher. | UndefinedBehaviorSanitizer (UBSan) is a detector of non-portable or erroneous program constructs which cause behavior which is not clearly defined in the ISO C standard. UBSan provides a large number of sub-options to enable / disable individual checks for different classes of undefined behavior. Consult the GCC[^gcc-instrumentation] and Clang[^clang-ubsan] documentation respectively for up-to-date information on supported sub-options.