News for hackers. Stuff that matters.
Re:Show HN: Automatic cleanup in C using with-statements by NullPrefix on Sunday May 31, 2020 @06:20PM (#23373368)
Hey, it's pretty nice.

Reminds of the old adage - You never code in plain C, you need to first #define some macros and then you can proceed with metaprogramming

Re:Show HN: Automatic cleanup in C using with-statements by taeber on Monday June 01, 2020 @09:27AM (#23378155)
Thank you! I'd much prefer to not have to use macros, but I tried to make the with/withif mimic what I wish was a real C statement.
Re:Show HN: Automatic cleanup in C using with-statements by mycall on Sunday May 31, 2020 @07:59PM (#23374218)
Unless you are doing embedded programming.
Re:Show HN: Automatic cleanup in C using with-statements by asguy on Sunday May 31, 2020 @08:07PM (#23374268)
Especially when you are doing embedded programming.

You think those GPIO registers are going to encode themselves?

Re:Show HN: Automatic cleanup in C using with-statements by kettro on Monday June 01, 2020 @04:04AM (#23376267)
Macros are the lifeblood of embedded C. I have a use case where I need to read, shift, and OR a value, then write back. If I need to do that for more than 1 thing, sure as shit I'll write a macro.