5 ms·
Author of the library here; AMA.
by earenndil 7y ago
Author of the library here; AMA.
- rwmj 7y agoWhy 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.
- Kipters 7y agoHow is support across compilers? Do clang and MSVC support it?
- rwmj 7y agoGCC and Clang yes. Do people even use MSVC to compile C (not C++) code? Last I heard it was years behind on the C standards. In any case few in the Linux community care too much about closed source compilers. Lack of MSVC support for cleanups would be amongst the least of your problems if you were trying to use it to compile systemd or libvirt.
- loeg 7y agoDoes MSVC support C99 yet? Much less C11 or a future C2x? Their priority has always been C++ and for some time their stance on C was basically "I guess we're willing to compile the subset of C that is valid C++."
- pwdisswordfish2 7y agoWhere'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 7y agoYou need to use nested functions if you want to have nontrivial behaviour in a cleanup, and nested functions are awful in c.
- loeg 7y agoSo don't have nontrivial behavior in a cleanup? That sounds about as antithetical to C as nested functions.