aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-05-29 16:07:24 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-05-29 16:07:24 +0200
commitd2013ee5952bbcf88906a832748783e372f3a939 (patch)
tree3ea461e528df72cfde0f08866275283ed3338098
parentce8e9ba530e1c43342b21dcf300096b67ca9a8ea (diff)
downloadnotes-d2013ee5952bbcf88906a832748783e372f3a939.tar.gz
notes-d2013ee5952bbcf88906a832748783e372f3a939.zip
gcc: list warn/opt
-rw-r--r--src/development/gcc.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/development/gcc.md b/src/development/gcc.md
index 39ae753..f2bd8a0 100644
--- a/src/development/gcc.md
+++ b/src/development/gcc.md
@@ -12,6 +12,8 @@ gcc -E [-dM] ...
- `-dM` list only `#define` statements
- `-###` dry-run, outputting exact compiler/linker invocations
- `-print-multi-lib` print available multilib configurations
+- `--help=<class>` print description of cmdline options for given class, eg
+ `warnings`, `optimizers`, `target`, `c`, `c++`
### Target options
```bash
@@ -22,6 +24,17 @@ gcc --help=target
gcc -march=native -Q --help=target
```
+### Warnings / optimizations
+```bash
+# List available warnings with short description.
+gcc --help=warnings
+# List available optimizations with short description.
+gcc --help=optimizers
+
+# Prepend --help with `-Q` to print wheter options are enabled or disabled
+# instead showing their description.
+```
+
## [Builtins][builtins]
### `__builtin_expect(expr, cond)`