[#108552] [Ruby master Bug#18782] Race conditions in autoload when loading the same feature with multiple threads. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18782 has been reported by ioquatix (Samuel Williams).
11 messages
2022/05/14
[ruby-core:108537] [Ruby master Bug#18777] NDEBUG macro defined after including ruby.h
From:
"shyouhei (Shyouhei Urabe)" <noreply@...>
Date:
2022-05-13 01:43:13 UTC
List:
ruby-core #108537
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 <assert.h>
#include <ruby.h>
int main() {
assert(0);
return 0;
}
```
I expect:
```bash
gcc test.c
./a.out
```
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--------------------------------
test.c (79 Bytes)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>