Bug #18777
closedNDEBUG macro defined after including ruby.h
Description
Hello,
When using ruby 3+, including ruby.h results in the NDEBUG macro becoming defined, which deactivates assertions.
This simple (see attached test.c file) example illustrates this:
I expect:
To fail, and it does not. Commenting the #include <ruby.h> yields the expected result.
I found several discussion in the issues regarding NDEBUG in Ruby 3+, but none seem to describe this particular behavior. Sorry if I missed something.
Thanks.
Files
Updated by shyouhei (Shyouhei Urabe) over 4 years ago
- Status changed from Open to Closed
This is intentional. Devs hate assertions. See also https://bugs.ruby-lang.org/issues/16837 .
Updated by Kerilk (Brice Videau) over 4 years ago
shyouhei (Shyouhei Urabe) wrote in #note-1:
This is intentional. Devs hate assertions. See also https://bugs.ruby-lang.org/issues/16837 .
Thanks for confirming.
Here is the workaround I use, should anybody with the same issue need a solution.