AW: [PATCH 2/2] ctime.3, strftime.3, strptime.3, timegm.3: Add [[gnu::nonnull]] to <time.h> prototypes
Paul Eggert
eggert@cs.ucla.edu
Thu Oct 21 17:40:12 GMT 2021
On 10/21/21 02:01, Alejandro Colomar (man-pages) via Libc-alpha wrote:
> 10 EXAMPLE In the declaration for an entity, attributes appertaining
> to that entity may appear at the start of the declarationand after the
> identifier for that declaration.
>
> [[deprecated]] void f [[deprecated]] (void); // valid
>
> Forward references: declarators (6.7.6), enumeration specifiers
> (6.7.2.2), initialization (6.7.9), typenames (6.7.7), type qualifiers
> (6.7.3).
> ]
>
> So we could put it in any of those 2 positions. Is there any reason
> that one is better (more readable / less ambiguous) than the other? We
> should decide very carefully which one to use.
"f (...)" is hardwired into people's brains for function calls, and we
shouldn't put anything between the "f" and the "(" to confuse this
longstanding syntactic pattern. So this stuff should go at the start of
the declaration, not after the identifier.
More information about the Libc-alpha
mailing list