From d2013ee5952bbcf88906a832748783e372f3a939 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Mon, 29 May 2023 16:07:24 +0200 Subject: gcc: list warn/opt --- src/development/gcc.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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=` 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)` -- cgit v1.2.3