From: "shyouhei (Shyouhei Urabe)" Date: 2022-05-13T01:43:13+00:00 Subject: [ruby-core:108537] [Ruby master Bug#18777] NDEBUG macro defined after including ruby.h Issue #18777 has been updated by shyouhei (Shyouhei Urabe). Status changed from Open to Closed This is intentional. Devs hate assertions. See also https://bugs.ruby-lang.org/issues/16837 . ---------------------------------------- Bug #18777: NDEBUG macro defined after including ruby.h https://bugs.ruby-lang.org/issues/18777#change-97580 * Author: Kerilk (Brice Videau) * Status: Closed * Priority: Normal * ruby -v: 3.0.2p107;3.1.2p20 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- 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: ```C #include #include int main() { assert(0); return 0; } ``` I expect: ```bash gcc test.c ./a.out ``` To fail, and it does not. Commenting the `#include ` 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-------------------------------- test.c (79 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: