Skip to content

Commit 146ce4b

Browse files
committed
Fix other considerations heading level in -ftrapv description
Signed-off-by: Thomas Nyman <[email protected]>
1 parent ade031b commit 146ce4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ Each of these options gives the compiler less freedom for optimizing the resulti
10091009

10101010
The `-ftrapv` option requires the compiler to emit checks to detect and trap overflows on signed integers unless it has compile time information of the value range to prove the operation doesn't overflow. As a result, `-ftrapv` is expected to have the largest performance impact out the options covered in this section.
10111011

1012-
### Other considerations
1012+
#### Other considerations
10131013

10141014
During link-time optimization (LTO), different compilation units may have been built with different arithmetic overflow behavior. The `-fno-strict-overflow`, `-fwrapv`, `-fno-trapv` and `-fno-strict-aliasing` are passed through to the link stage and take precedece over `-fstrict-overflow` semantics for compilation units with conflicting behavior[^gcc-flto]. In practice this means that software where certain modules benefit from `-fstrict-overflow` for perormance, but others use `-fno-strict-overflow` to improve security, may loose out on the performance benefits with `-fno-strict-overflow` taking precedence during LTO.
10151015

0 commit comments

Comments
 (0)