Top all-time · #6828
Explorations
Personal blog · echorand.meprogrammingsystems
Explorations is a personal blog at echorand.me about programming and systems. Since 2015, 12 different Hacker News readers have linked it 13 times, most often “Using the __cleanup__ variable attribute in GCC”. It is still writing: the last post was on 2026-11-01, and you can follow it by feed.
Too few sampled comments (4) to say how often HN recommends it.?
Why HN links it
HN readers link this blog's notes on C programming, especially its article on the GCC/Clang cleanup attribute as a defer-like mechanism. Commenters cite it as a reference for C resource cleanup.
Summarised by Claude from a sample of 4 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
echo $RANDOM. Exploring Software and writing about it.
Most-linked posts?
- Using the __cleanup__ variable attribute in GCC4 people · 4 mentions · first linked 2015-08-14
What Hacker News says?
C compilers have scope guard extensions. http://echorand.me/site/notes/articles/c_cleanup/cleanup_att... Systemd uses it: https://github.com/systemd/systemd/blob/5809f340fd7e5e6c76e2...
Comment linking /site/notes/articles/c_cleanup/cleanup_attribute_c.html
on “Fuchsia is not Linux”Submitted Using the __cleanup__ variable attribute in GCC as a story · 24 points
HN discussionGCC has a similar extension for defering to end of scope, which is basically most of use cases(cleanup function is usually free or some destructor/sanity check function). https://echorand.me/site/notes/articles/c_cleanup/cleanup_at...
Comment linking /site/notes/articles/c_cleanup/cleanup_attribute_c.html
on “A Defer Mechanism for C”Submitted How does ping roughly work over IPv4 on Linux? as a story · 11 points
HN discussionTo the point of having something similar to defer in C. Gnu C has attribute cleanup[1][2] which is supported by both GCC and Clang. Sure its not portable in the strictest sense but these two compilers offer wide enough support that may be sufficient for your use case. systemd uses it, for example. glib is also a good general purpose library, you do not need to use GObject or it's event loop to make use of it. [1] ht…
Comment linking /site/notes/articles/c_cleanup/cleanup_attribute_c.html
on “Comparing C and Rust Network Protocol Exercises”Submitted Computer programming, and friction as a learning activity as a story · 2 points
HN discussion> Best tool to build a single page, text-focused static content site? Vim. Ok, seriously. You probably want Sphinx. Some very nice, mobile-friendly themes (I like Paramiko), and it can easily build a single page with table of contents automatically from a collection of rst or markdown pages. It's technically for documentation, but some people use it for their static web sites and blogs. Ideal for a text-driven site.…
Comment linking /site/notes/articles/sphinx/static_html.html
on “Ask HN: Best tool to build a single page, text-focused static content site?”Submitted Embedding files in Go using the "embed" package as a story · 2 points
HN discussionSubmitted Using the __cleanup__ variable attribute in GCC as a story · 2 points
HN discussionSubmitted Introducing distributed tracing in your Python application via Zipkin as a story · 2 points
HN discussionSubmitted Writing HTTP client middleware in Go as a story · 1 points
HN discussionSubmitted Pyodide, PyScript – Monkey patching requests as a story · 1 points
HN discussionSubmitted A virtualenv first approach to Python projects as a story · 1 points
HN discussion