From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Jakub Jelinek <jakub@redhat.com>,
"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
Joseph Myers <joseph@codesourcery.com>
Subject: Re: [C2x] Disallow function attributes after function identifier
Date: Fri, 10 Jun 2022 23:47:18 +0100 [thread overview]
Message-ID: <CAH6eHdS30Pg8HgjUx7NMRTdpXNesyuzC9FmivdvJFB2AWGvMUg@mail.gmail.com> (raw)
In-Reply-To: <520a1013-ec4a-b3ca-871b-5e8110f61d37@gmail.com>
On Fri, 10 Jun 2022, 22:29 Alejandro Colomar via Gcc, <gcc@gcc.gnu.org>
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/
>
next prev parent reply other threads:[~2022-06-10 22:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 20:40 Alejandro Colomar
2022-06-10 21:09 ` Joseph Myers
2022-06-10 21:35 ` Alejandro Colomar
2022-06-10 21:16 ` Jakub Jelinek
2022-06-10 21:31 ` Alejandro Colomar
2022-06-10 22:47 ` Jonathan Wakely [this message]
2022-06-11 9:03 ` Alejandro Colomar
2022-06-11 12:08 ` Gabriel Ravier
2022-06-11 20:20 ` Alejandro Colomar
2022-06-13 15:54 ` Jonathan Wakely
2022-06-11 12:53 ` Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAH6eHdS30Pg8HgjUx7NMRTdpXNesyuzC9FmivdvJFB2AWGvMUg@mail.gmail.com \
--to=jwakely.gcc@gmail.com \
--cc=alx.manpages@gmail.com \
--cc=gcc@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=joseph@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).