News for hackers. Stuff that matters.
Re:A Defer Mechanism for C by dataflow on Monday December 14, 2020 @10:16AM (#25418459)
This is... wild. I had no idea attrribute((cleanup)) was a thing in CNU C. Did the C folks finally discover the concept of a destructor? What's the point of resisting C++ so adamantly if they're going to introduce the same features with an awful nonstandard syntax in an ad-hoc manner anyway?
Re:A Defer Mechanism for C by ufo on Monday December 14, 2020 @10:17AM (#25418479)
The attribute(cleanup) is just exposing to C the C++ destructor functionality that is already implemented in the compiler. That's why it's using the awkward nonstandard syntax.
Re:A Defer Mechanism for C by nvarsj on Tuesday December 15, 2020 @08:37AM (#25430141)
C++ is a lot more than defer, obviously. There’s nothing wrong with extending the language for common use cases.