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: 1707603 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=P0UWcdqu; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NGNCd287sz23nf for ; Tue, 22 Nov 2022 10:00:44 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DBC2D384F485 for ; Mon, 21 Nov 2022 23:00:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBC2D384F485 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669071640; bh=rC3Ypc04FIzUssoQNhYk2I6wzhQjF3UKzOPVacdcUFI=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=P0UWcdqupk65U06g/Avl+OUU3oG1+8PWBa/V9I+c7YMGRE/1YPnCM4O+bPzLOEefd DLRCw2cPNIrDIxL8CGDBaisiTgOJ1arSW2D1iFkPcEjI/m/DaZhhEn3Ot3w0zpJfS0 T6GcZxCmM7T4jB4a4TJlhd4HueVEnJ0V9PYb2MWU= 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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