Hacker News new | ask | show | jobs
by cassepipe 213 days ago
It is surprisingly hard to find information about it, do you have any ? From what I can guess it's a new syntax but it's the feature itself is still an extension ?
4 comments

The `[[attribute]]` syntax is new, the builtin ones in C23 are `[[deprecated]]`, `[[fallthrough]]`, `[[maybe_unused]]`, `[[nodiscard]]`, `[[noreturn]]`, `[[reproducible]]`, and `[[unsequenced]]`.
The feature itself is probably still __attribute__((cleanup(f))). That’s documented at https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attribute...
C standard _may_ eventually have a feature semantically equivalent, but very different syntactically:

https://thephd.dev/_vendor/future_cxx/technical%20specificat...

Discussion:

https://thephd.dev/_vendor/future_cxx/papers/C%20-%20Improve...