Hacker News new | ask | show | jobs
by lostmsu 13 days ago
The article stops short of actually telling why would anyone need NOT_CONSTANT
1 comments

Keep reading beyond the ad...

In short, git has a 'create_ref_symlink' function that is replaced with a macro to '-1' on some build configurations. This means that any code which is conditioned on the success of create_ref_symlink would trigger a compiler warning when built with -Wunreachable-code. NOT_CONSTANT supresses this warning by preventing the compiler from realizing the code is unreachable. It also prevents the compiler from eliminating the dead code, but presumably that has only a negligable impact.