[ruby-core:122639] [Ruby Bug#21497] building issue when using gcc15, because C23 is default

Issue #21497 has been reported by liuzx (Liu Z.). ---------------------------------------- Bug #21497: building issue when using gcc15, because C23 is default https://bugs.ruby-lang.org/issues/21497 * Author: liuzx (Liu Z.) * Status: Open * ruby -v: 3.2, 3.3, 3.4 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- https://github.com/ruby/ruby/pull/13736 1. for ruby 3.3, 3.4: when compiling using gcc 15 with "-flto -Werror=lto-type-mismatch", ext/io/console/extconf.h will have:
#define HAVE_RB_IO_PATH 1 #define HAVE_RB_IO_DESCRIPTOR 1 #define HAVE_RB_IO_GET_WRITE_IO 1 #define HAVE_RB_IO_CLOSED_P 1 #define HAVE_RB_IO_OPEN_DESCRIPTOR 1
the build is failed with:
console.c:1417:1: error: static declaration of ‘rb_io_closed_p’ follows non-static declaration 1417 | rb_io_closed_p(VALUE io) | ^~~~~~~~~~~~~~ ../../.././include/ruby/io.h:385:7: note: previous declaration of ‘rb_io_closed_p’ with type ‘VALUE(VALUE)’ {aka ‘long unsigned int(long un signed int)’} 385 | VALUE rb_io_closed_p(VALUE io); | ^~~~~~~~~~~~~~
see https://bugs.gentoo.org/945643#c17 for more detail analysis 2. for ruby 3.2, 3.3, 3.4: when enable socks5 support, gcc15 will report:
init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); | ^~~~~~~~ ~~~~~~~ In file included from init.c:11: rubysocket.h:294:5: note: declared here 294 | int Rconnect(); | ^~~~~~~~
sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 33 | SOCKSinit("ruby"); | ^~~~~~~~~ ~~~~~~ In file included from sockssocket.c:11: rubysocket.h:293:6: note: declared here 293 | void SOCKSinit(); | ^~~~~~~~~

Issue #21497 has been updated by liuzx (Liu Z.). 1 had been fixed in commit https://github.com/ruby/io-console/commit/dd013030dd276a7372df34cf43ada1c14d... ---------------------------------------- Bug #21497: building issue when using gcc15, because C23 is default https://bugs.ruby-lang.org/issues/21497#change-113912 * Author: liuzx (Liu Z.) * Status: Open * ruby -v: 3.2, 3.3, 3.4 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- https://github.com/ruby/ruby/pull/13736 1. for ruby 3.3, 3.4: when compiling using gcc 15 with "-flto -Werror=lto-type-mismatch", ext/io/console/extconf.h will have:
#define HAVE_RB_IO_PATH 1 #define HAVE_RB_IO_DESCRIPTOR 1 #define HAVE_RB_IO_GET_WRITE_IO 1 #define HAVE_RB_IO_CLOSED_P 1 #define HAVE_RB_IO_OPEN_DESCRIPTOR 1
the build is failed with:
console.c:1417:1: error: static declaration of ‘rb_io_closed_p’ follows non-static declaration 1417 | rb_io_closed_p(VALUE io) | ^~~~~~~~~~~~~~ ../../.././include/ruby/io.h:385:7: note: previous declaration of ‘rb_io_closed_p’ with type ‘VALUE(VALUE)’ {aka ‘long unsigned int(long un signed int)’} 385 | VALUE rb_io_closed_p(VALUE io); | ^~~~~~~~~~~~~~
see https://bugs.gentoo.org/945643#c17 for more detail analysis 2. for ruby 3.2, 3.3, 3.4: when enable socks5 support, gcc15 will report:
init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); | ^~~~~~~~ ~~~~~~~ In file included from init.c:11: rubysocket.h:294:5: note: declared here 294 | int Rconnect(); | ^~~~~~~~
sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 33 | SOCKSinit("ruby"); | ^~~~~~~~~ ~~~~~~ In file included from sockssocket.c:11: rubysocket.h:293:6: note: declared here 293 | void SOCKSinit(); | ^~~~~~~~~

Issue #21497 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED to 3.2: REQUIRED, 3.3: REQUIRED, 3.4: DONE ruby_3_4 commit:782aef10bbdb63aba6d71e4f5f1876888c70efcb merged revision(s) commit:d77e02bd85ab7f841df8d473bac214b9a92a3506. ---------------------------------------- Bug #21497: building issue when using gcc15, because C23 is default https://bugs.ruby-lang.org/issues/21497#change-114049 * Author: liuzx (Liu Z.) * Status: Closed * ruby -v: 3.2, 3.3, 3.4 * Backport: 3.2: REQUIRED, 3.3: REQUIRED, 3.4: DONE ---------------------------------------- https://github.com/ruby/ruby/pull/13736 1. for ruby 3.3, 3.4: when compiling using gcc 15 with "-flto -Werror=lto-type-mismatch", ext/io/console/extconf.h will have:
#define HAVE_RB_IO_PATH 1 #define HAVE_RB_IO_DESCRIPTOR 1 #define HAVE_RB_IO_GET_WRITE_IO 1 #define HAVE_RB_IO_CLOSED_P 1 #define HAVE_RB_IO_OPEN_DESCRIPTOR 1
the build is failed with:
console.c:1417:1: error: static declaration of ‘rb_io_closed_p’ follows non-static declaration 1417 | rb_io_closed_p(VALUE io) | ^~~~~~~~~~~~~~ ../../.././include/ruby/io.h:385:7: note: previous declaration of ‘rb_io_closed_p’ with type ‘VALUE(VALUE)’ {aka ‘long unsigned int(long un signed int)’} 385 | VALUE rb_io_closed_p(VALUE io); | ^~~~~~~~~~~~~~
see https://bugs.gentoo.org/945643#c17 for more detail analysis 2. for ruby 3.2, 3.3, 3.4: when enable socks5 support, gcc15 will report:
init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); | ^~~~~~~~ ~~~~~~~ In file included from init.c:11: rubysocket.h:294:5: note: declared here 294 | int Rconnect(); | ^~~~~~~~
sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 33 | SOCKSinit("ruby"); | ^~~~~~~~~ ~~~~~~ In file included from sockssocket.c:11: rubysocket.h:293:6: note: declared here 293 | void SOCKSinit(); | ^~~~~~~~~

Issue #21497 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.2: REQUIRED, 3.3: REQUIRED, 3.4: DONE to 3.2: REQUIRED, 3.3: DONE, 3.4: DONE ruby_3_3 commit:1e37f34eaad715119d49c13e0bf6e6c54c5cbca6 merged revision(s) commit:d77e02bd85ab7f841df8d473bac214b9a92a3506. ---------------------------------------- Bug #21497: building issue when using gcc15, because C23 is default https://bugs.ruby-lang.org/issues/21497#change-114112 * Author: liuzx (Liu Z.) * Status: Closed * ruby -v: 3.2, 3.3, 3.4 * Backport: 3.2: REQUIRED, 3.3: DONE, 3.4: DONE ---------------------------------------- https://github.com/ruby/ruby/pull/13736 1. for ruby 3.3, 3.4: when compiling using gcc 15 with "-flto -Werror=lto-type-mismatch", ext/io/console/extconf.h will have:
#define HAVE_RB_IO_PATH 1 #define HAVE_RB_IO_DESCRIPTOR 1 #define HAVE_RB_IO_GET_WRITE_IO 1 #define HAVE_RB_IO_CLOSED_P 1 #define HAVE_RB_IO_OPEN_DESCRIPTOR 1
the build is failed with:
console.c:1417:1: error: static declaration of ‘rb_io_closed_p’ follows non-static declaration 1417 | rb_io_closed_p(VALUE io) | ^~~~~~~~~~~~~~ ../../.././include/ruby/io.h:385:7: note: previous declaration of ‘rb_io_closed_p’ with type ‘VALUE(VALUE)’ {aka ‘long unsigned int(long un signed int)’} 385 | VALUE rb_io_closed_p(VALUE io); | ^~~~~~~~~~~~~~
see https://bugs.gentoo.org/945643#c17 for more detail analysis 2. for ruby 3.2, 3.3, 3.4: when enable socks5 support, gcc15 will report:
init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); | ^~~~~~~~ ~~~~~~~ In file included from init.c:11: rubysocket.h:294:5: note: declared here 294 | int Rconnect(); | ^~~~~~~~
sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 33 | SOCKSinit("ruby"); | ^~~~~~~~~ ~~~~~~ In file included from sockssocket.c:11: rubysocket.h:293:6: note: declared here 293 | void SOCKSinit(); | ^~~~~~~~~

Issue #21497 has been updated by hsbt (Hiroshi SHIBATA). Backport changed from 3.2: REQUIRED, 3.3: DONE, 3.4: DONE to 3.2: DONE, 3.3: DONE, 3.4: DONE Merged at https://github.com/ruby/ruby/pull/14001 for Ruby 3.2 ---------------------------------------- Bug #21497: building issue when using gcc15, because C23 is default https://bugs.ruby-lang.org/issues/21497#change-114140 * Author: liuzx (Liu Z.) * Status: Closed * ruby -v: 3.2, 3.3, 3.4 * Backport: 3.2: DONE, 3.3: DONE, 3.4: DONE ---------------------------------------- https://github.com/ruby/ruby/pull/13736 1. for ruby 3.3, 3.4: when compiling using gcc 15 with "-flto -Werror=lto-type-mismatch", ext/io/console/extconf.h will have:
#define HAVE_RB_IO_PATH 1 #define HAVE_RB_IO_DESCRIPTOR 1 #define HAVE_RB_IO_GET_WRITE_IO 1 #define HAVE_RB_IO_CLOSED_P 1 #define HAVE_RB_IO_OPEN_DESCRIPTOR 1
the build is failed with:
console.c:1417:1: error: static declaration of ‘rb_io_closed_p’ follows non-static declaration 1417 | rb_io_closed_p(VALUE io) | ^~~~~~~~~~~~~~ ../../.././include/ruby/io.h:385:7: note: previous declaration of ‘rb_io_closed_p’ with type ‘VALUE(VALUE)’ {aka ‘long unsigned int(long un signed int)’} 385 | VALUE rb_io_closed_p(VALUE io); | ^~~~~~~~~~~~~~
see https://bugs.gentoo.org/945643#c17 for more detail analysis 2. for ruby 3.2, 3.3, 3.4: when enable socks5 support, gcc15 will report:
init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); | ^~~~~~~~ ~~~~~~~ In file included from init.c:11: rubysocket.h:294:5: note: declared here 294 | int Rconnect(); | ^~~~~~~~
sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 33 | SOCKSinit("ruby"); | ^~~~~~~~~ ~~~~~~ In file included from sockssocket.c:11: rubysocket.h:293:6: note: declared here 293 | void SOCKSinit(); | ^~~~~~~~~
participants (4)
-
hsbt (Hiroshi SHIBATA)
-
k0kubun (Takashi Kokubun)
-
liuzx (Liu Z.)
-
nagachika (Tomoyuki Chikanaga)