Using the __cleanup__ variable attribute in GCC(echorand.me)
echorand.me
Using the __cleanup__ variable attribute in GCC
http://echorand.me/site/notes/articles/c_cleanup/cleanup_attribute_c.html
4 comments
I learned about this a few years ago, but haven't made use of it at all. But I can see how it could be handy. I like using the vector attribute to make gcc generate vector instructions.
Actually this is pretty cool, you can make the same sort of semantics as C++ stack based objects in plain C. With a couple macros you could make it pretty much feature equivalent.
Thanks for posting that!
Thanks for posting that!
Pretty cool.
Does anyone have recommendations on great books that cover advanced C internals (other than K&R) and/or GNU extensions for C?
Does anyone have recommendations on great books that cover advanced C internals (other than K&R) and/or GNU extensions for C?
Expert C Programming: Deep Secrets (http://www.amazon.com/Expert-Programming-Peter-van-Linden/dp...)
Advanced C: Tips and Techniques (http://www.amazon.com/Advanced-Techniques-Hayden-Books-Libra...)
Advanced C: Tips and Techniques (http://www.amazon.com/Advanced-Techniques-Hayden-Books-Libra...)
Or, you know, just use C++ if you want to do this.
No worries, it doesn't hurt, you won't have to use iterators and new.
No worries, it doesn't hurt, you won't have to use iterators and new.
Nah. I think that for many programs the GNU extensions to C provide a better tradeoff in terms of expressiveness vs. added complexity than the truckload of arbitrary features that is C++.