From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 9AA183856254 for ; Fri, 10 Jun 2022 22:47:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9AA183856254 Received: by mail-wr1-x42a.google.com with SMTP id o8so330719wro.3 for ; Fri, 10 Jun 2022 15:47:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/83LCpOPQMGjk5q2pkm5A40itMB+aFEy1Ud+7eutdck=; b=5Q2f6+u9c8iU71hJY52i7mMyo2KxssOhGdpXdLziPbd2d85fZ0K0N0054NMYMRTL/u S74mzApxoegEl0N/tmH+WWyeIlU2h1P8Va/q+GRNiUTS0kzPemV995aHGTwkFqzT0Afc oKWHY0pYjamCm1e3mouXW/b0e1yH0EuTKtBvSNUz8HpXG/2C4601oJhyFRLmVI8iUgl/ mte/jNBhvxVtNe7FKDi9JACHj3slwiGD26k4M5XQcWoD7SRAB96QQ2gai4lIg6TZZdc6 PjA2a56YjHOvJDnWDOnEPklgKc7Dm6IPUQd3Huy49y19cA7L06Af3grno1iHrCOCoqu/ sHIQ== X-Gm-Message-State: AOAM533HjsqFhOLBOoDgjQbhfmR7iKd96ocjN/e7ySAVAo4D209Bl6S8 5tNlZyM4kUb9eXnw9ykny22J+CamcyaXk++EIwo= X-Google-Smtp-Source: ABdhPJxaa0XoCEBLrSthDgW3wxcTtyeBBD1vkmTAhqiVNDiRGkrk/94w1D24XD6VuGz6q3PIK+2LdVIhinQjAI8giQg= X-Received: by 2002:a05:6000:1812:b0:210:2eb1:4606 with SMTP id m18-20020a056000181200b002102eb14606mr47293474wrh.593.1654901250342; Fri, 10 Jun 2022 15:47:30 -0700 (PDT) MIME-Version: 1.0 References: <520a1013-ec4a-b3ca-871b-5e8110f61d37@gmail.com> In-Reply-To: <520a1013-ec4a-b3ca-871b-5e8110f61d37@gmail.com> From: Jonathan Wakely Date: Fri, 10 Jun 2022 23:47:18 +0100 Message-ID: Subject: Re: [C2x] Disallow function attributes after function identifier To: Alejandro Colomar Cc: Jakub Jelinek , "gcc@gcc.gnu.org" , Joseph Myers X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2022 22:47:34 -0000 On Fri, 10 Jun 2022, 22:29 Alejandro Colomar via Gcc, wrote: > [I reordered some of your answers, to better answer] > > Hi Jakub, > > On 6/10/22 23:16, Jakub Jelinek wrote: > > On Fri, Jun 10, 2022 at 10:40:15PM +0200, Alejandro Colomar via Gcc > wrote: > >> So, could you please drop that from C2x? > > > > No! > > > > > [[attr0]] void foo (void), bar (void); > > appertains to both declarations, while > > True, but. > > > void baz [[attr1]] (void), qux [[attr2]] (void); > > appertains to only the specific declaration. > > That's true. But how many of these are spotted in the wild, > non-theoretical world? > > In the world I live, they mean effectively (but not theoretically) the > same thing :) > > > > void corge (void) [[attr3]]; > > appertains to the function type. > > Yes, that one is clear. > > > > > > > For one it diverges from C++, but also it means something different > > at the different locations. > > Well, I'd argue the same reasons to remove it from C++. Don't know how > useful that feature is for C++, though. I bet not much, but am not an > expert in the language. > It's used in libstdc++ because I couldn't get an attribute to work in any other location, because it isn't valid at other positions in a constrained function template. So no, we can't remove it from C++. > But, are we sure we want to add this to C? You know how difficult is to > revert mistakes in C, as opposed to C++, where additions and > deprecations are more common. > To the core language grammar? Are you sure about that? > This is basically breaking any ability to separately (textually) parse C > files without the build context. > > > Regards, > > Alex > > > -- > Alejandro Colomar > Linux man-pages comaintainer; http://www.kernel.org/doc/man-pages/ > http://www.alejandro-colomar.es/ >