diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2020-04-09 07:37:53 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2020-04-09 07:37:53 +0900 |
commit | 78eec3cdc5ff0664b421e041f4f70a814542b914 (patch) | |
tree | a73d3f8265a292c6b1630b0a92263c26dcf3c004 /include | |
parent | e7128aa772787a9c9e95708e2d2534484861a765 (diff) |
include/ruby/3: Stop RUBY3_UNREACHABLE_RETURN to suppress a SunC warning
I don't find how to suppress a false positive "unreachable" warning of
the Sun compiler:
```
"./include/ruby/3/core/rtypeddata.h", line 163: warning: statement not
reached
"./include/ruby/3/memory.h", line 256: warning: statement not reached
```
This warnings make mkmf test fail:
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris10-sunc/ruby-master/log/20200408T170004Z.fail.html.gz
```
1) Failure:
TestMkmf::TestConvertible#test_typeof_builtin
[/export/home/users/chkbuild/cb-sunc/tmp/build/20200408T170004Z/ruby/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
...
"cc -I.
-I/export/home/users/chkbuild/cb-sunc/tmp/build/20200408T170004Z/ruby/.ext/include/sparc-solaris2.10
-I/export/home/users/chkbuild/cb-sunc/tmp/build/20200408T170004Z/ruby/include
-I./test -I/opt/csw/include -D_XOPEN_SOURCE=600 -DFFI_NO_RAW_API -g
-c conftest.c"
"/export/home/users/chkbuild/cb-sunc/tmp/build/20200408T170004Z/ruby/include/ruby/3/core/rtypeddata.h",
line 163: warning: statement not reached
"/export/home/users/chkbuild/cb-sunc/tmp/build/20200408T170004Z/ruby/include/ruby/3/memory.h",
line 256: warning: statement not reached
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 */
```
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/3/core/rtypeddata.h | 2 | ||||
-rw-r--r-- | include/ruby/3/memory.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/ruby/3/core/rtypeddata.h b/include/ruby/3/core/rtypeddata.h index cc00fa2500..1627d327f9 100644 --- a/include/ruby/3/core/rtypeddata.h +++ b/include/ruby/3/core/rtypeddata.h @@ -160,7 +160,9 @@ RTYPEDDATA_TYPE(VALUE obj) #if ! RUBY_NDEBUG if (RB_UNLIKELY(! RTYPEDDATA_P(obj))) { rb_unexpected_type(obj, RUBY_T_DATA); +# if ! defined(__sun) RUBY3_UNREACHABLE_RETURN(NULL); +# endif } #endif diff --git a/include/ruby/3/memory.h b/include/ruby/3/memory.h index 9001fd2ab3..18ed1d81cb 100644 --- a/include/ruby/3/memory.h +++ b/include/ruby/3/memory.h @@ -253,7 +253,9 @@ ruby3_size_mul_or_raise(size_t x, size_t y) } else { ruby_malloc_size_overflow(x, y); +# if ! defined(__sun) RUBY3_UNREACHABLE_RETURN(0); +# endif } } |