Skip to content

Commit 1fbb989

Browse files
committed
Demote -fhardened subsection to correct level
Signed-off-by: Thomas Nyman <[email protected]>
1 parent ae033c8 commit 1fbb989

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ The `-fexceptions` option is also needed for C code that needs to interoperate w
994994

995995
---
996996

997-
## Enable pre-determined set of hardening options in GCC
997+
### Enable pre-determined set of hardening options in GCC
998998

999999
| Compiler Flag | Supported since | Description |
10001000
|:----------------------------------------- |:---------------:|:------------------------------------------------------------------- |
@@ -1003,7 +1003,7 @@ The `-fexceptions` option is also needed for C code that needs to interoperate w
10031003

10041004
The `-fhardened` umbrella option enables a pre-determined set of hardening options for C and C++ on GNU/Linux targets[^gcc-fhardened]. The precise set of options may change between major releases of GCC. The exact set of options for a specific GCC version can be displayed using the `--help=hardened` option.
10051005

1006-
### Additional Considerations
1006+
#### Additional Considerations
10071007

10081008
Options explicitly specified on the compiler command line always take precedence over options implied by `-fhardened`. For example, `-fhardened` in GCC 14 enables [`-fstack-protector-strong`](#-fstack-protector-strong) but specifying `-fstack-protector -fhardened` or `-fhardened -fstack-protector` on the compiler command line will enable the weaker `-fstack-protector` instead of `-fstack-protector-strong`.
10091009

0 commit comments

Comments
 (0)