From patchwork Mon Nov 21 23:00:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 24044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1880212wrr; Mon, 21 Nov 2022 15:01:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf48C6fB7poVU1SN31uYgM5C8H5ervN5ijvMy4pd1dCqcF41dLpE/qp3zwz2vsANfJs1mpom X-Received: by 2002:a17:906:a2d1:b0:781:bc28:f455 with SMTP id by17-20020a170906a2d100b00781bc28f455mr17045741ejb.170.1669071664925; Mon, 21 Nov 2022 15:01:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669071664; cv=none; d=google.com; s=arc-20160816; b=yB8NvArnvvWbiuam+gpf7gGLNa6ReyrAw/tr4kirTtp/ZaJXeCzSQVYDR3/xBDwJtD rThkhIIDdbB8xmWLHXQWnZwSIyDr31Ekg7l1JwbhAJhf0qSRVkqSxK5QZdgC1W92PjbF W42hi1lysBHX6s63n+cadlV8gGC2f5ENqRRM4hwsFAYPaxWQbl2vEG5dbygfGyh63M/n B8+5/ssYafRJ+xWBqK0P5tlzXXcY1+CCbIxpPGnrzrHx6yqkc5irjUU3YYzno6zSknGK xHmMzwYWMi3FtzPqxh9M+9HxZFND3b1xoCvofKcukdgfAg/AvxANvsmyFbXXufFwHu4J qeaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=rC3Ypc04FIzUssoQNhYk2I6wzhQjF3UKzOPVacdcUFI=; b=O64ISXdjbJhR12bKbS52L2r2aaP9+DvCs63mtnJLQ/yCvPk2G/yNAa3A2edpWIajNH c0ibJ2cNt3g3slMK+WkaSJsmg4M7o+4UO+k05tWTgwNhWTzXYXI4U/Z9iHelyvo4U+g9 d6+w1tCX8h3FalmRWqZavYOMBbAHVxPArQ1V2eVLt1PJtFvsDTFl9WhWPBvjaNjQeRy5 WHTF9dO6J96ZpHrmzsXaI8DDaMH0kq9MHCqKyQNoFMTXtRmkPSLiYlSQFW9SbKBPBNKz nv0X1rZTXKw+IJMu9wkjyiSjob0KDpnLHVy02/9wKHIbz3sKJV/BEapfH29lMXqU2RrO jn5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oHDwvjWD; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ez15-20020a056402450f00b0044ee4ec8915si790453edb.39.2022.11.21.15.01.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 15:01:04 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oHDwvjWD; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E88E738518B3 for ; Mon, 21 Nov 2022 23:01:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E88E738518B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669071663; bh=rC3Ypc04FIzUssoQNhYk2I6wzhQjF3UKzOPVacdcUFI=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=oHDwvjWD0U0uE9GyrjTdcoWpXHwRu+w8FqclxRXaCpJkD908upMc0l7lEJm/uUK6x nO4mi5QJbWauIXItvzB7MjBiUqJEe0rlfaorKfVvX4ktP2H0nprD0nVWnX3wJ+iuLN LNapn6BwnRQXooM38v57UFVX+m8GNKiqLmvEkz/Q= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2655E385843E for ; Mon, 21 Nov 2022 23:00:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2655E385843E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-VcaPWciXOPO-sByKZL5GtQ-1; Mon, 21 Nov 2022 18:00:13 -0500 X-MC-Unique: VcaPWciXOPO-sByKZL5GtQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C2FB3833A0D for ; Mon, 21 Nov 2022 23:00:12 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.202]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 764D340C6E13; Mon, 21 Nov 2022 23:00:12 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2ALN08Zq331712 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 22 Nov 2022 00:00:09 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2ALN08PZ331348; Tue, 22 Nov 2022 00:00:08 +0100 Date: Tue, 22 Nov 2022 00:00:07 +0100 To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] c++: Fix up -fcontract* options Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750148489853552187?= X-GMAIL-MSGID: =?utf-8?q?1750148489853552187?= Hi! 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-21 Jakub Jelinek * c.opt (fcontract-assumption-mode=, fcontract-continuation-mode=, fcontract-role=, fcontract-semantic=): Add RejectNegative. (fcontract-build-level=): Terminate description with dot. Jakub --- gcc/c-family/c.opt.jj 2022-11-19 09:21:14.314444706 +0100 +++ gcc/c-family/c.opt 2022-11-21 23:51:55.605736499 +0100 @@ -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) -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