Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Now, if C had something like Go's "defer"...

In GCC and Clang you can use __attribute__((cleanup)) to achieve this. I think MSVC has a similar construct.

I'm pretty sure I've seen a portable "defer" library for C somewhere.



> I think MSVC has a similar construct.

Microsoft rather focus in C++.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: