News for hackers. Stuff that matters.
Re:C: Simple Defer, Ready to Use by scott_s on Monday January 06, 2025 @04:19PM (#42615994)
Look at the Linux kernel. It uses gotos for exactly this purpose, and it’s some of the cleanest C code you’ll ever read.

C++ destructors are great for this, but are not possible in C. Destructors require an object model that C does not have.

There are no comments on this comment yet.