4

Someone, somewhere, in the standard C library headers for my particular libc implementation, is #undef'ing assert() unconditionally and it's causing massive headaches.

Fuck the C preprocessor. There's no way I can track this down it seems, but my assert implementation is being quietly ignored and I have no recourse for it.

Gotta change all of my asserts to a different name now. Fun.

*long sigh*

Comments
  • 3
    Yes, I did a verbose print of all included headers and did some extensive grepping. No luck.

    At this point it feels like some magic logic somewhere and magic makes me angry.

    Stop making magic shit, folks.
  • 1
    @halfflat Most build tools do that. NDEBUG is definitely supposed to be defined for production builds. CMake isn't special in this regard.

    And my problem isn't that assert() isn't defined, it's that I #define my own assert() macro which somewhere in the standard C library headers is being #undef'd in favor of the standard #assert macro.
  • 1
    Wait WTF glibc does #undef assert at the very top of assert.h. WTF?!?!?!

    WHY.

    Ugh.
  • 2
    Also, why did grep not find it?

    Because they use a tab character between `#undef` and `assert`. Like fucking idiots.

    Man I want to slap whoever wrote that *sofuckinghard*.
  • 0
    @halfflat CMake is very much not a windows build system haha. It's more like an amorphus frankenstein project.

    And yeah, NDEBUG is a standard macro, defined by the C standards.
Add Comment