From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id A7031385455F; Wed, 23 Nov 2022 08:30:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7031385455F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669192208; bh=QPi78p3M8SlBMQZjVzH84QZktW5zOJbkw/y7V5ShcIo=; h=From:To:Subject:Date:From; b=HKtu0GDPc1ANyzb5MxQGuf8QdHX+9lWVhTb25JrjHkaXnMOrdHw1FEs0AndZwHVhm LjutIgXwF08cw6eeKgT4UeEGWlPXQnVmydRzOl59pL99euhD3DVTcGQNLr4nRccYAw n9eEkRk+AZmecf6h8X0B6LyAmCFDl1dwTbOsV7S4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4260] c++: Fix up -fcontract* options X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/master X-Git-Oldrev: 3138db588a46d445876c0358df55fa3995c6f221 X-Git-Newrev: e1b503d7068cbaf4be938c02eb6686ea5a716fee Message-Id: <20221123083008.A7031385455F@sourceware.org> Date: Wed, 23 Nov 2022 08:30:08 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e1b503d7068cbaf4be938c02eb6686ea5a716fee commit r13-4260-ge1b503d7068cbaf4be938c02eb6686ea5a716fee Author: Jakub Jelinek Date: Wed Nov 23 09:29:04 2022 +0100 c++: Fix up -fcontract* options I've noticed +FAIL: compiler driver --help=c++ option(s): "^ +-.*[^:.]\$" absent from output: " -fcontract-build-level=[off|default|audit] Specify max contract level to generate runtime checks for" error, this is due to missing dot at the end of the description. The second part of the first hunk should fix that, but while at it, I find it weird that some options don't have RejectNegative, yet for options that accept an argument a negative option looks weird and isn't really handled. Though, shall we have those [on|off] options at all? Those are inconsistent with all other boolean options gcc has. Every other boolean option is -fwhatever for it being on and -fno-whatever for it being off, shouldn't the options be without arguments and accept negatives (-fcontract-assumption-mode vs. -fno-contract-assumption-mode etc.)? 2022-11-23 Jakub Jelinek * c.opt (fcontract-assumption-mode=, fcontract-continuation-mode=, fcontract-role=, fcontract-semantic=): Add RejectNegative. (fcontract-build-level=): Terminate description with dot. Diff: --- gcc/c-family/c.opt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 90088804e64..4b0539132c6 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -1692,12 +1692,12 @@ EnumValue Enum(on_off) String(on) Value(1) fcontract-assumption-mode= -C++ Joined +C++ Joined RejectNegative -fcontract-assumption-mode=[on|off] Enable or disable treating axiom level contracts as assumptions (default on). fcontract-build-level= C++ Joined RejectNegative --fcontract-build-level=[off|default|audit] Specify max contract level to generate runtime checks for +-fcontract-build-level=[off|default|audit] Specify max contract level to generate runtime checks for. fcontract-strict-declarations= C++ Var(flag_contract_strict_declarations) Enum(on_off) Joined Init(0) RejectNegative @@ -1708,15 +1708,15 @@ C++ Var(flag_contract_mode) Enum(on_off) Joined Init(1) RejectNegative -fcontract-mode=[on|off] Enable or disable all contract facilities (default on). fcontract-continuation-mode= -C++ Joined +C++ Joined RejectNegative -fcontract-continuation-mode=[on|off] Enable or disable contract continuation mode (default off). fcontract-role= -C++ Joined +C++ Joined RejectNegative -fcontract-role=: Specify the semantics for all levels in a role (default, review), or a custom contract role with given semantics (ex: opt:assume,assume,assume) fcontract-semantic= -C++ Joined +C++ Joined RejectNegative -fcontract-semantic=: Specify the concrete semantics for level fcoroutines