From: jaruga@... Date: 2020-12-14T14:15:19+00:00 Subject: [ruby-core:101445] [Ruby master Bug#17385] Test failures on gcc 11 Issue #17385 has been updated by jaruga (Jun Aruga). > JFYI tests for various compiles in our CI suite currently stick to Ubuntu bionic (18.04) because this was the last release which shipped gcc 4.x. OTOH gcc 11 on Ubuntu seems hirsute (21.04) exclusive for now. I see. Thanks for the info. My hope is that people in ubuntu-toolchain-r will add gcc-11 for older platforms in near future, as gcc-11 is still in development for now. My another hope for gcc-11 to support the older platforms is the one from Debian side, for Ubuntu to pick up. It's only available on the experimental repo. https://tracker.debian.org/pkg/gcc-11 For our CI, I assume you are talking about `.github/workflows/compilers.yml`, right? Can not we select `os` in the `matrix` of `compilers.yml`? If we can we can be available gcc-11 on a newer Ubuntu version. I am still not familiar with GitHub Actions syntax. > PS. This is not an issue for clang. I love how LLVM team provides every version they have to every OS they know. Oh it's cool. Though I am not sure which page you see for the "how LLVM team provides every version they have to every OS they know", I can see the official LLVM site provides clang-11 on Ubuntu 20.04 and 16.04. https://releases.llvm.org/download.html https://github.com/llvm/llvm-project/releases/tag/llvmorg-11.0.0 https://packages.ubuntu.com/groovy/clang-11 ---------------------------------------- Bug #17385: Test failures on gcc 11 https://bugs.ruby-lang.org/issues/17385#change-89215 * Author: jaruga (Jun Aruga) * Status: Closed * Priority: Normal * Target version: 3.0 * Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED ---------------------------------------- There is gcc 11 (development version) [1]. On Fedora rawhide (Fedora 34), the gcc version is 11.0.0-0.7.fc34. I got 2 test failures on Fedora 34. The failures come from a warning `-Wsizeof-array-div` that is a new feature on gcc 11. Here is the log. ``` + make check 'TESTS=-v ' 'MSPECOPT=-fs -P '\''raises TypeError if one of the passed exceptions is not a Module'\''' ... 1) Failure: TestMkmf::TestConvertible#test_typeof_builtin [/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/test/mkmf/test_convertible.rb:9]: convertible_int: checking for convertible type of short... -------------------- short -------------------- convertible_int: checking for convertible type of int... -------------------- int -------------------- convertible_int: checking for convertible type of long... -------------------- long -------------------- convertible_int: checking for convertible type of signed short... -------------------- failed "gcc -o conftest -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC conftest.c -L. -L/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a -L. -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -rdynamic -Wl,-export-dynamic -m64 -lruby-static -lpthread -lrt -lrt -lgmp -ldl -lcrypt -lm -lm -lc" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: warning: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Wsizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return !!argv[argc]; 6: } /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: warning: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Wsizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ checked program was: /* begin */ 1: #include "ruby.h" 2: 3: typedef signed short rbcv_typedef_; 4: 5: /*top*/ 6: int conftest_const[((rbcv_typedef_)-1 < 0) ? 1 : -1]; /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -Werror -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: error: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Werror=sizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ conftest.c:6:12: error: conflicting types for 'foo' 6 | extern int foo(); | ^~~ conftest.c:5:22: note: previous declaration of 'foo' was here 5 | extern rbcv_typedef_ foo(); | ^~~ cc1: all warnings being treated as errors checked program was: /* begin */ 1: #include "ruby.h" 2: 3: typedef signed short rbcv_typedef_; 4: 5: extern rbcv_typedef_ foo(); 6: extern int foo(); /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -Werror -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: error: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Werror=sizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors checked program was: /* begin */ 1: #include "ruby.h" 2: 3: typedef signed short rbcv_typedef_; 4: 5: extern rbcv_typedef_ foo(); 6: extern short foo(); /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -Werror -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: error: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Werror=sizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ conftest.c:6:13: error: conflicting types for 'foo' 6 | extern long foo(); | ^~~ conftest.c:5:22: note: previous declaration of 'foo' was here 5 | extern rbcv_typedef_ foo(); | ^~~ cc1: all warnings being treated as errors checked program was: /* begin */ 1: #include "ruby.h" 2: 3: typedef signed short rbcv_typedef_; 4: 5: extern rbcv_typedef_ foo(); 6: extern long foo(); /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -Werror -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: error: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Werror=sizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ conftest.c:6:18: error: conflicting types for 'foo' 6 | extern long long foo(); | ^~~ conftest.c:5:22: note: previous declaration of 'foo' was here 5 | extern rbcv_typedef_ foo(); | ^~~ cc1: all warnings being treated as errors checked program was: /* begin */ 1: #include "ruby.h" 2: 3: typedef signed short rbcv_typedef_; 4: 5: extern rbcv_typedef_ foo(); 6: extern long long foo(); /* end */ -------------------- .. <"short"> expected but was . 2) Failure: TestMkmf::TestConvertible#test_typeof_typedef [/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/test/mkmf/test_convertible.rb:22]: convertible_int: checking for convertible type of test1_t... -------------------- failed "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: warning: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Wsizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: typedef test1_t rbcv_typedef_; 5: 6: /*top*/ 7: int conftest_const[((rbcv_typedef_)-1 < 0) ? 1 : -1]; /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -Werror -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: error: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Werror=sizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ conftest.c:8:12: error: conflicting types for 'foo' 8 | extern int foo(); | ^~~ conftest.c:7:22: note: previous declaration of 'foo' was here 7 | extern rbcv_typedef_ foo(); | ^~~ cc1: all warnings being treated as errors checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: typedef test1_t rbcv_typedef_; 6: 7: extern rbcv_typedef_ foo(); 8: extern int foo(); /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -Werror -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: error: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Werror=sizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: typedef test1_t rbcv_typedef_; 6: 7: extern rbcv_typedef_ foo(); 8: extern short foo(); /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -Werror -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: error: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Werror=sizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ conftest.c:8:13: error: conflicting types for 'foo' 8 | extern long foo(); | ^~~ conftest.c:7:22: note: previous declaration of 'foo' was here 7 | extern rbcv_typedef_ foo(); | ^~~ cc1: all warnings being treated as errors checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: typedef test1_t rbcv_typedef_; 6: 7: extern rbcv_typedef_ foo(); 8: extern long foo(); /* end */ "gcc -I. -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include -I./test -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -m64 -Werror -c conftest.c" In file included from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/assume.h:29, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/backward/2/assume.h:24, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/defines.h:73, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/ruby.h:23, from /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby.h:31, from conftest.c:1: /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: error: expression does not compute the number of elements in this array; element type is 'VALUE' {aka 'long unsigned int'}, not 'char' [-Werror=sizeof-array-div] 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rbasic.h:40:59: note: add parentheses around the second 'sizeof' to silence this warning 40 | RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T))) | ^ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/cast.h:33:29: note: in definition of macro 'RBIMPL_CAST' 33 | # define RBIMPL_CAST(expr) (expr) | ^~~~ /builddir/build/BUILD/ruby-3.0.0-1cfc6e7b7a/include/ruby/internal/core/rstring.h:70:31: note: in expansion of macro 'RBIMPL_EMBED_LEN_MAX_OF' 70 | RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1 | ^~~~~~~~~~~~~~~~~~~~~~~ conftest.c:8:18: error: conflicting types for 'foo' 8 | extern long long foo(); | ^~~ conftest.c:7:22: note: previous declaration of 'foo' was here 7 | extern rbcv_typedef_ foo(); | ^~~ cc1: all warnings being treated as errors checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: typedef test1_t rbcv_typedef_; 6: 7: extern rbcv_typedef_ foo(); 8: extern long long foo(); /* end */ -------------------- .. <"short"> expected but was . Finished tests in 806.091775s, 25.9722 tests/s, 3308.1320 assertions/s. 20936 tests, 2666658 assertions, 2 failures, 0 errors, 52 skips ruby -v: ruby 3.0.0dev (2020-12-04 master 1cfc6e7b7a) [x86_64-linux] ``` Seeing the gcc 11 release note [2], it seems that the new warning `-Wsizeof-array-div` causes the failures. > C family > New warnings: > -Wsizeof-array-div, enabled by -Wall, warns about divisions of two sizeof operators when the first one is applied to an array and the divisor does not equal the size of the array element. Here is the detail of the warning. [3] Could you fix it? Thank you. [1] https://gcc.gnu.org/ [2] https://gcc.gnu.org/gcc-11/changes.html [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91741 -- https://bugs.ruby-lang.org/ Unsubscribe: