[C2x] Disallow function attributes after function identifier
Alejandro Colomar
alx.manpages@gmail.com
Fri Jun 10 21:31:37 GMT 2022
[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.
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.
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 part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20220610/fb94aa9b/attachment.sig>
More information about the Gcc
mailing list