Re: AW: [PATCH 2/2] ctime.3, strftime.3, strptime.3, timegm.3: Add [[gnu::nonnull]] to <time.h> prototypes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux