summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_gcc
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2020-02-14 01:58:20 +0100
committerAxel Beckert <abe@deuxchevaux.org>2020-02-14 01:58:20 +0100
commitbfc5d42735c1660263904ec5254cccf539a0a458 (patch)
tree9bbb81b4a53941427e6f9e65ae55027d9108df8c /Completion/Unix/Command/_gcc
parent74561cc51b8867e43cb2937ab2edfb36e2a829bf (diff)
parent643de931640e01aa246723d2038328ef33737965 (diff)
downloadzsh-bfc5d42735c1660263904ec5254cccf539a0a458.tar.gz
zsh-bfc5d42735c1660263904ec5254cccf539a0a458.zip
Merge tag 'zsh-5.7.1-test-3' into debian
Test release: 5.7.1-test-3
Diffstat (limited to 'Completion/Unix/Command/_gcc')
-rw-r--r--Completion/Unix/Command/_gcc24
1 files changed, 22 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc
index 9de0b79b1..9ec09200e 100644
--- a/Completion/Unix/Command/_gcc
+++ b/Completion/Unix/Command/_gcc
@@ -13,6 +13,11 @@ if [[ "$service" = -value-* ]]; then
args2=()
fi
else
+ # On some systems (macOS), cc/gcc/g++ are actually clang; treat them accordingly
+ [[ $service != clang* ]] &&
+ _pick_variant clang=clang unix --version &&
+ service=clang-$service
+
args2=( '*:input file:_files -g "*.([cCmisSoak]|cc|cpp|cxx|ii|k[ih])(-.)"' )
fi
@@ -350,10 +355,12 @@ if [[ "$service" = clang* ]]; then
"-nostdinc[Do not search standard system directories or compiler builtin directories for include files]"
"-nostdlibinc[Do not search standard system directories for include files]"
"-nobuiltininc[Do not search builtin directory for include files]"
+ "--help[Display this information]"
)
else
args+=(
'-flto=-[Enable link-time optimization]::jobs:'
+ '*--help=-[Display this information]:class:->help'
)
fi
@@ -427,7 +434,6 @@ args+=(
'*-isystem:second include path directory (system):_files -/'
'--sysroot=-[Use <directory> as the root directory for headers and libraries]:directory:_files -/'
'-pass-exit-codes[Exit with highest error code from a phase]'
- '*--help=-[Display this information]:class:->help'
'--target-help[Display target specific command line options]'
'-dumpspecs[Display all of the built in spec strings]'
'-dumpversion[Display the version of the compiler]'
@@ -440,6 +446,7 @@ args+=(
'-print-multi-os-directory[Display the relative path to OS libraries]'
'-print-sysroot[Display the target libraries directory]'
'-print-sysroot-headers-suffix[Display the sysroot suffix used to find headers]'
+ '-save-stats=-[Save code generation statistics]:location:(cwd obj)'
'-save-temps[Do not delete intermediate files]'
'-no-canonical-prefixes[Do not canonicalize paths when building relative prefixes to other gcc components]'
'-pipe[Use pipes rather than intermediate files]'
@@ -675,7 +682,6 @@ args+=(
'-Wunderflow[Warn about underflow of numerical constant expressions]'
'-Wuninitialized[Warn about uninitialized automatic variables]'
'-Wunknown-pragmas[Warn about unrecognized pragmas]'
- '-Wunreachable-code[Does nothing. Preserved for backward compatibility]'
'-Wunsafe-loop-optimizations[Warn if the loop cannot be optimized due to nontrivial assumptions]'
'-Wunsuffixed-float-constants[Warn about unsuffixed float constants]'
'-Wunused-but-set-parameter[Warn when a function parameter is only set, otherwise unused]'
@@ -729,6 +735,20 @@ args+=(
'-Werror=-[Treat specified warning as error (or all if none specified)]::warning:->werror'
'-Wfatal-errors[Exit on the first error occurred]'
)
+# clang specific warnings
+if [[ "$service" = clang* ]]; then
+ args+=(
+ '-Wunreachable-code[Warn on code that will not be executed]'
+ '-Wunreachable-code-aggressive[Controls -Wunreachable-code, -Wunreachable-code-break, -Wunreachable-code-return]'
+ '-Wunreachable-code-break[Warn when break will never be executed]'
+ '-Wunreachable-code-loop-increment[Warn when loop will be executed only once]'
+ '-Wunreachable-code-return[Warn when return will not be executed]'
+ )
+else
+ args+=(
+ '-Wunreachable-code[Does nothing. Preserved for backward compatibility]'
+ )
+fi
# optimizers (from --help=optimizers), except for -O
args+=(
# --help=optimizers,^joined