From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id dc530dec for ; Sun, 5 Jan 2020 18:52:48 +0000 (UTC) Received: (qmail 12430 invoked by alias); 5 Jan 2020 18:52:42 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45245 Received: (qmail 13838 invoked by uid 1010); 5 Jan 2020 18:52:42 -0000 X-Qmail-Scanner-Diagnostics: from 52-119-123-37.public.monkeybrains.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25684. spamassassin: 3.4.2. Clear:RC:0(52.119.123.37):SA:0(1.1/5.0):. Processed in 1.282567 secs); 05 Jan 2020 18:52:42 -0000 X-Envelope-From: eax@fasteagle X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at fasteagle does not designate permitted sender hosts) From: Eitan Adler To: zsh-workers@zsh.org Cc: Eitan Adler Subject: [PATCH] _gcc: add some clang specific warnings Date: Sun, 5 Jan 2020 18:52:11 +0000 Message-Id: <20200105185211.11610-1-lists@eitanadler.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Qmail-Scanner-2.11: added fake Content-Type header Content-Type: text/plain This adds some missing completions to the _gcc completer for clang. Sadly clang does not support --help=warnings so it is not complete. Signed-off-by: Eitan Adler --- Completion/Unix/Command/_gcc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 0061cfa3b..bbfbc2b9e 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -350,10 +350,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 +429,6 @@ args+=( '*-isystem:second include path directory (system):_files -/' '--sysroot=-[Use 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]' @@ -676,7 +677,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]' @@ -730,6 +730,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 -- 2.24.1