8000 Fix build error with gcc 15 by Watson1978 · Pull Request #375 · ohler55/ox · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix build error with gcc 15 #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Watson1978
Copy link
Contributor

This patch will fix the following build errors when compiling ox with gcc 15.1:

Related to https://bugs.ruby-lang.org/issues/21286

PS C:\src\ox\ext\ox> gcc -v
Using built-in specs.
COLLECT_GCC=C:\Ruby34-x64\msys64\ucrt64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/Ruby34-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-15.1.0/configure --prefix=/ucrt64 --with-local-prefix=/ucrt64/local --with-native-system-header-dir=/ucrt64/include --libexecdir=/ucrt64/lib --enable-bootstrap --enable-checking=release --with-arch=nocona --with-tune=generic --enable-mingw-wildcard --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-backtrace=yes --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/ucrt64 --with-mpfr=/ucrt64 --with-mpc=/ucrt64 --with-isl=/ucrt64 --with-pkgversion='Rev1, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --enable-plugin --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.0 (Rev1, Built by MSYS2 project)


PS C:\src\ox\ext\ox> make
generating ox-x64-mingw-ucrt.def
compiling base64.c
compiling builder.c
builder.c: In function 'ox_init_builder':
builder.c:929:53: error: passing argument 3 of 'rb_define_module_function' from incompatible pointer type [-Wincompatible-pointer-types]
  929 |     rb_define_module_function(builder_class, "new", builder_new, -1);
      |                                                     ^~~~~~~~~~~
      |                                                     |
      |                                                     VALUE (*)(int,  VALUE *, VALUE) {aka long long unsigned int (*)(int,  long long unsigned int *, long long unsigned int)}
In file included from C:/Ruby34-x64/include/ruby-3.4.0/ruby/internal/anyargs.h:78,
                 from C:/Ruby34-x64/include/ruby-3.4.0/ruby/ruby.h:27,
                 from C:/Ruby34-x64/include/ruby-3.4.0/ruby.h:38,
                 from buf.h:34,
                 from builder.c:11:
C:/Ruby34-x64/include/ruby-3.4.0/ruby/internal/method.h:112:70: note: expected 'VALUE (*)(void)' {aka 'long long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long long unsigned int (*)(int,  long long unsigned int *, long long unsigned int)'}
  112 | void rb_define_module_function(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity);
      |                                                              ~~~~~~~~^~~~~~~~~~~~~~
builder.c:343:14: note: 'builder_new' declared here
  343 | static VALUE builder_new(int argc, VALUE *argv, VALUE self) {
      |              ^~~~~~~~~~~
builder.c:930:54: error: passing argument 3 of 'rb_define_module_function' from incompatible pointer type [-Wincompatible-pointer-types]
  930 |     rb_define_module_function(builder_class, "file", builder_file, -1);
      |                                                      ^~~~~~~~~~~~
      |                                                      |
      |                                                      VALUE (*)(i
8000
nt,  VALUE *, VALUE) {aka long long unsigned int (*)(int,  long long unsigned int *, long long unsigned int)}
C:/Ruby34-x64/include/ruby-3.4.0/ruby/internal/method.h:112:70: note: expected 'VALUE (*)(void)' {aka 'long long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long long unsigned int (*)(int,  long long unsigned int *, long long unsigned int)'}
  112 | void rb_define_module_function(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity);
      |                                                              ~~~~~~~~^~~~~~~~~~~~~~
builder.c:389:14: note: 'builder_file' declared here
  389 | static VALUE builder_file(int argc, VALUE *argv, VALUE self) {
      |              ^~~~~~~~~~~~
builder.c:931:52: error: passing argument 3 of 'rb_define_module_function' from incompatible pointer type [-Wincompatible-pointer-types]
  931 |     rb_define_module_function(builder_class, "io", builder_io, -1);
      |                                                    ^~~~~~~~~~
      |                                                    |
      |                                                    VALUE (*)(int,  VALUE *, VALUE) {aka long long unsigned int (*)(int,  long long unsigned int *, long long unsigned int)}
C:/Ruby34-x64/include/ruby-3.4.0/ruby/internal/method.h:112:70: note: expected 'VALUE (*)(void)' {aka 'long long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long long unsigned int (*)(int,  long long unsigned int *, long long unsigned int)'}
  112 | void rb_define_module_function(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity);
      |                                                              ~~~~~~~~^~~~~~~~~~~~~~
builder.c:442:14: note: 'builder_io' declared here
  442 | static VALUE builder_io(int argc, VALUE *argv, VALUE self) {
      |              ^~~~~~~~~~

...(snip)...

@ohler55
Copy link
Owner
ohler55 commented Apr 29, 2025

Looks like Windows has issue with the changes.

@Watson1978
Copy link
Contributor Author

ox has dependency to bigdecimal gem, but bigdecimal has same issue.
ruby/bigdecimal#315

@ohler55
Copy link
Owner
ohler55 commented Apr 30, 2025

Maybe modify the action targets to skip windows with gcc 15.1

5B1E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0