top | item 22624615

(no title)

earenndil | 6 years ago

Author of the library here; AMA.

discuss

order

rwmj|6 years ago

Why not use __attribute__((cleanup))? It's widely used in real code (eg. systemd has been using it for years) and there's effort going on to get the mechanism standardized in the next C standard.

pwdisswordfish2|6 years ago

Where's the effort? I happen to follow WG14 proposals closely, but I haven't seen this particular one discussed prominently or incorporated into the latest working draft. I don't even remember a single paper with this feature submitted to WG14 for consideration.

earenndil|6 years ago

You need to use nested functions if you want to have nontrivial behaviour in a cleanup, and nested functions are awful in c.

Kipters|6 years ago

How is support across compilers? Do clang and MSVC support it?