From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669071614; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=rC3Ypc04FIzUssoQNhYk2I6wzhQjF3UKzOPVacdcUFI=; b=hssPggVXKl907tTrQhGGMgzwa/BRh2rjAcf1cp4Pt9g48z79tXWdsRZIvN9TiWO2SEyzH9 0s96VaZ0FSi8CenOp1sP8aCH5Y1irJXPOOeWn+wCgto9uD0FcHZHD6wnKJbJsLZoXMv683 03NVW3Q73WXIkeqbxdOoxX0GBFdN8nY= 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 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] c++: Fix up -fcontract* options Message-ID: Reply-To: Jakub Jelinek 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-Type: text/plain; charset=us-ascii 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 List-Id: 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. --- 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 Jakub