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 8C0DA3858CDA for ; Mon, 6 Nov 2023 15:42:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C0DA3858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8C0DA3858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699285328; cv=none; b=M7n1/FUWMHQeqP9wi74QFyH2R3edkAMe9vYkldN/pLsQdw+a5tFxBjAiJmgAoHYFz6uO/Yr05+kwHuOD5b9ArOFlGrDsDlcITEZzv7NvQaAjems1k/FYFQi9LfLqY5SpU0Q5JUACUZTSIliQ/yis/3IkeM2LZjxBzNLRM9P171Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699285328; c=relaxed/simple; bh=fEchcqi0qW/HTg7iPW5HaXzfo9nbyR3p/eDyaHz1RE8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=VwPqbJsiKP5wqG+BVuU3sXY9GiwK8o3ZdWQRPZzKFxIjDXCelBlO+Qk3L6Zfm061RxvVzKJYfeqrziAFQCHE1I2U4EPbHlhl/MoQXdEjvAxbPzRZXANA21mSzZAQ4/T1JQrP1RPRyVL0dvNS//k8r25b+mb9nzBD0UCQlotPFJ4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699285326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HR9rpPoWLXM/0FvTfWDCMLJ6anVnGIGKnIBYh0xK4l0=; b=iQyc6QTu5Yz+cf7VfwvlcpLfXvy61C7NY5wV4B/nFEhiBWZ+T6xcAOsdC1CfWrsC/zrAqr wWtCXY7NF1g1uu6NXEyEbbqOvZ6Iw1QJbu0njOHC2fLS08Uu9gSqommD3+3vetkbqJrwBS McuS5n+LWc1P9odJtXqYfx+LiubmtkQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-5XCDkYqcPlyASdhd9-OwNA-1; Mon, 06 Nov 2023 10:42:04 -0500 X-MC-Unique: 5XCDkYqcPlyASdhd9-OwNA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A865811E8D for ; Mon, 6 Nov 2023 15:42:04 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFB21492BFA; Mon, 6 Nov 2023 15:42:03 +0000 (UTC) From: Florian Weimer To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2] c-family: Enable -fpermissive for C and ObjC References: <874jhzgemo.fsf@oldenburg.str.redhat.com> <87r0l3ezgr.fsf@oldenburg.str.redhat.com> Date: Mon, 06 Nov 2023 16:42:02 +0100 In-Reply-To: (Jakub Jelinek's message of "Mon, 6 Nov 2023 15:31:37 +0100") Message-ID: <878r7aga7p.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.6 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: * Jakub Jelinek: > On Mon, Nov 06, 2023 at 03:19:32PM +0100, Florian Weimer wrote: >> * Jakub Jelinek: >> >> > On Mon, Nov 06, 2023 at 03:06:39PM +0100, Florian Weimer wrote: >> >> Future changes will treat some C front end warnings similar to >> >> -Wnarrowing. >> >> >> >> gcc/ >> >> >> >> * doc/invoke.texi (Warning Options): Mention C diagnostics >> >> for -fpermissive. >> >> >> >> gcc/c-family/ >> >> >> >> * c.opt (fpermissive): Enable for C and ObjC. >> >> * c-opts.cc (set_std_c89): Enable -fpermissive. >> > >> > Won't this set flag_permissive even for -std=c89 -std=c99 ? >> > Haven't tried, but if set_std_c* is called multiple times if more than >> > one -std= option appears, then perhaps this should be done later after >> > processing all options, not during that processing. >> >> Ugh, you are right. >> >> What would be the right place to do this kind of final option >> processing? Where those SET_OPTION_IF_UNSET are? > > c_common_post_options ? > Generally, we have global_options, which are the values of the options > (implicit or explicit) and then another variable of the same type, > global_options_set, which uses all values just as booleans whether the > option was set explicitly or not. Yes, c_common_post_options seems to work. Thanks for the hint regarding global_options_set. I can use it to make -std=gnu89 -fno-permissive do something useful. I'm going to send an update patch. Florian