From: "byroot (Jean Boussier) via ruby-core" Date: 2026-07-07T06:04:51+00:00 Subject: [ruby-core:125945] [Ruby Bug#22184] error: conflicting types for ‘OnigUChar’; have ‘char16_t’ {aka ‘short unsigned int’} since Issue #22184 has been updated by byroot (Jean Boussier). Assignee set to byroot (Jean Boussier) Thank you for the report, I will try to find a way to embed T_REGEXP without including `onigmo.h` (no idea how at this point). ---------------------------------------- Bug #22184: error: conflicting types for ���OnigUChar���; have ���char16_t��� {aka ���short unsigned int���} since https://bugs.ruby-lang.org/issues/22184#change-117912 * Author: yahonda (Yasuo Honda) * Status: Open * Assignee: byroot (Jean Boussier) * ruby -v: ruby 4.1.0dev (2026-07-07T04:45:34Z master 86a6b79e5d) +PRISM [x86_64-linux] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- This issue was found at Rails Nightly CI https://buildkite.com/rails/rails-nightly/builds/4522#019f393b-4212-453f-8f4f-c1a538af23e5/L3911 ### Steps to reproduce 1. Install these packages (this repro uses Ubuntu 26.04) ``` sudo apt-get install -y gcc make libicu-dev ``` 2. Create extconf.rb and repro.c - extconf.rb ``` require "mkmf" create_makefile("repro") ``` - repro.c ``` #include #include ``` 3. Run `ruby.extconf & make` ``` ruby extconf make ``` ### Expected behavior It should pass like: ``` $ ruby extconf.rb && make creating Makefile linking shared-object repro.so ``` ### Actual behavior It raises the ` error: conflicting types for ���OnigUChar���; have ���char16_t��� {aka ���short unsigned int���}` ``` $ ruby extconf.rb creating Makefile $ make compiling repro.c In file included from /home/yahonda/.local/share/mise/installs/ruby/trunk/include/ruby-4.1.0+4/ruby/internal/core/rregexp.h:30, from /home/yahonda/.local/share/mise/installs/ruby/trunk/include/ruby-4.1.0+4/ruby/internal/core.h:31, from /home/yahonda/.local/share/mise/installs/ruby/trunk/include/ruby-4.1.0+4/ruby/ruby.h:29, from /home/yahonda/.local/share/mise/installs/ruby/trunk/include/ruby-4.1.0+4/ruby.h:38, from repro.c:1: /home/yahonda/.local/share/mise/installs/ruby/trunk/include/ruby-4.1.0+4/ruby/onigmo.h:76:16: error: conflicting types for ���OnigUChar���; have ���char16_t��� {aka ���short unsigned int���} 76 | # define UChar OnigUChar | ^~~~~~~~~ /home/yahonda/.local/share/mise/installs/ruby/trunk/include/ruby-4.1.0+4/ruby/onigmo.h:79:24: note: previous declaration of ���OnigUChar��� with type ���OnigUChar��� {aka ���unsigned char���} 79 | typedef unsigned char OnigUChar; | ^~~~~~~~~ make: *** [Makefile:251: repro.o] Error 1 $ ``` ### Workaround Setting `CPPFLAGS=-DONIG_ESCAPE_UCHAR_COLLISION` workarounds this error. ```ruby $ ruby -v ruby 4.1.0dev (2026-07-07T04:45:34Z master 86a6b79e5d) +PRISM [x86_64-linux] yahonda@myubuntu:~/src/github.com/yahonda/ruby-head-uchar-repro$ ruby extconf.rb creating Makefile $ make CPPFLAGS=-DONIG_ESCAPE_UCHAR_COLLISION compiling repro.c linking shared-object repro.so $ ``` Reference https://github.com/rails/buildkite-config/pull/187 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/