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

> Use __attribute__((cleanup)). It's available in GCC and Clang

Really, don’t do this, it’s a portability nightmare. If you’re going to write C stick to code that easy to run under MSVC.



Running under MSVC is overrated and more trouble than its worth. Clang and mingw-w64 GCC work just fine for targeting Windows.


Disagree. It’s fine and trivially easy. It’s only hard for Linux people who build software for Linux first and only. Then have a shocked pikachu face when they need to run in a different environment.

mingw is radically more problematic than MSVC. Don’t use mingw.


Running under MSVC implies I'm building on Windows. In reality I'm cross compiling with Clang.


It’s a shame that glibc is so badly designed that cross-compiling for Linux is only vaguely possible because Andrew Kelley moved mountains via Zig.




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

Search: