Should “count” be quoted?
Should “count” be quoted?
Posted Jul 18, 2024 3:08 UTC (Thu) by songmaster (subscriber, #1748)Parent article: Silva: How to use the new counted_by attribute in C (and Linux)
In Jon’s 2023 article he showed a different attribute name and the count member name in quotes inside the attribute:
__attribute__((element_count(“count”)))
The online GCC and Clang documentation only mention counted_by and no sign of the quotes, so did the compilers agree on a better name while implementing this?
Posted Jul 18, 2024 4:54 UTC (Thu)
by Tarnyko (guest, #90061)
[Link]
#if __has_attribute(__counted_by__)
Should “count” be quoted?
# define __counted_by(member) __attribute__((__counted_by__(member)))
#else
# define __counted_by(member)
#endif
