Age | Commit message (Collapse) | Author |
|
Devs do not love "impl".
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
Devs do not love "3". The only exception is RUBY3_KEYWORDS in parse.y,
which seems unrelated to our interests.
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
This shall fix compile errors.
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
Devs do not love "3".
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
[Bug #16465] [Bug #16801]
[Fix GH-2795] [Fix GH-2944] [Fix GH-3045] [Fix GH-3093]
Note: Backporting shouldn't modify object.h and instead can use
struct_new_kw which is basically a duplicate implementation of
rb_class_new_instance_pass_kw
Co-authored-by: Yusuke Endoh <[email protected]>
Co-authored-by: John Hawthorn <[email protected]>
Co-authored-by: Adam Hess <[email protected]>
Co-authored-by: Jose Cortinas <[email protected]>
Co-authored-by: Jean Boussier <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/3093
|
|
As zero variadic macro argument, `rb_scan_args(argc, argv, "")`
(or `"0"`), means 0-arity method and should be defined so, that
case doesn't need to consider.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3071
|
|
|
|
|
|
|
|
It seems gcc prior to 5 suffered from preprocessor bug. We have to
provide workarounds.
See https://github.com/ruby/ruby/runs/591138012
----
Here is something interesting. According to C99, strictly speaking,
the gcc behaviour was in fact legal(!) and everything else were
wrong. This was not a bug of gcc, rather a bug of the ISO C Standard.
This defect was reported to the committee as DR#412, and fixed
accordingly. All tested compilers now conform C17's updated
preprocessor description.
See http://www.open-std.org/JTC1/SC22/WG14/www/docs/dr_412.htm
|
|
FreeBSD's <sys/cdefs.h> is broken. Cygwin is also affected by that.
We need to avoid using them.
See also:
https://github.com/freebsd/freebsd/commit/d1c67819db000c02d3a9c79f3651c10aeedad1a0
https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;f=newlib/libc/include/sys/cdefs.h;h=44d6d53977e6bc82c2b1e6dbe8ae7f310b260604
|
|
This reverts commit 443389effc37308ce1a3c3a840082a344fc6af56.
This reverts commit d94960f22ec2de3a3855305cb51343806d2b46c7.
Inclusion of header files must be explicit. Every file shall directly
include what is necessary.
https://github.com/include-what-you-use/include-what-you-use says:
> When every file includes what it uses, then it is possible to edit any
> file and remove unused headers, without fear of accidentally breaking
> the upwards dependencies of that file. It also becomes easy to
> automatically track and update dependencies in the source code.
Though we don't use iwyu itself, the principle quoted above is a good
thing that we can agree.
Now that include guards were added to every and all of the headers
inside of our project this changeset does not increase compile time, at
least on my machine.
Notes:
Merged: https://github.com/ruby/ruby/pull/3023
|
|
According to MSVC manual (*1), cl.exe can skip including a header file
when that:
- contains #pragma once, or
- starts with #ifndef, or
- starts with #if ! defined.
GCC has a similar trick (*2), but it acts more stricter (e. g. there
must be _no tokens_ outside of #ifndef...#endif).
Sun C lacked #pragma once for a looong time. Oracle Developer Studio
12.5 finally implemented it, but we cannot assume such recent version.
This changeset modifies header files so that each of them include
strictly one #ifndef...#endif. I believe this is the most portable way
to trigger compiler optimizations. [Bug #16770]
*1: https://docs.microsoft.com/en-us/cpp/preprocessor/once
*2: https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
Notes:
Merged: https://github.com/ruby/ruby/pull/3023
|
|
between rb_scan_args_set and rb_scan_args_assign +
rb_scan_args_result.
|
|
Same as 133ae0807d661eac174b59c6e91c11a40975baea
|
|
Revert "Revert "include/ruby/3/core/rtypeddata.h: Use 0 instead of NULL for C++ compiler""
Revert "include/ruby/3/core/rtypeddata.h: Use 0 instead of NULL for C++ compiler"
Revert "include/ruby/3: Skip RUBY3_UNREACHABLE_RETURN for icc"
Revert "include/ruby/3: Stop RUBY3_UNREACHABLE_RETURN to suppress a SunC warning"
This reverts commit b965e7e05e4307e3c4b396673e63dbc493ef2f20.
This reverts commit d2bb2e066b5a914283dd3ea473fc1762183af013.
This reverts commit 8ab4c55e7a70f5a5bd041d93f425eeef4a47c01e.
This reverts commit 78eec3cdc5ff0664b421e041f4f70a814542b914.
After https://github.com/ruby/ruby/pull/3011, we no longer need these
ifdef guards.
|
|
icc warns at this line.
> include/ruby/3/core/rstring.h(126): warning #413: variable "retval" has an uninitialized const field
> struct RString retval;
> ^
This must not be a problem because uninitialized const field is not used
at all. But the warnings are annoying. Let us suppress them.
Notes:
Merged: https://github.com/ruby/ruby/pull/3011
|
|
icc warns side effects for RUBY3_ASSUME like this:
> ./include/ruby/3/value_type.h(202): warning #2261: __assume expression with side effects discarded
> RUBY3_ASSUME(RB_FLONUM_P(obj));
> ^
Which is a false positive (RB_FLONUM_P has no side effect). It seems
there is no way for us to tell icc that a functin is safe inside of
__assume. Just suppress the warning instead.
Notes:
Merged: https://github.com/ruby/ruby/pull/3011
|
|
This macro has to be truthy, otherwise the `+0` trick above evalues
RUBY3_HAS_BUILTIN(__builtin_unreachable) to be always false.
Notes:
Merged: https://github.com/ruby/ruby/pull/3011
|
|
Without this patch, 20k files are opened (openat syscall) because
of duplicate includes. This patch reduced it to 3k and build time
was reduced compile time of range.o from 15sec -> 3sec on my machine.
[Bug #16772]
Notes:
Merged: https://github.com/ruby/ruby/pull/3010
|
|
compiler"
This reverts commit d2bb2e066b5a914283dd3ea473fc1762183af013.
It didn't work:
https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20200409T050004Z.log.html.gz#end
```
In file included from ../../.././include/ruby/3/core.h(32),
from ../../.././include/ruby/ruby.h(28),
from ../../.././include/ruby.h(33),
from init.c(1):
../../.././include/ruby/3/core/rtypeddata.h(164): warning #967: conversion from "int" to "const struct rb_data_type_struct *"; sizes do not match
RUBY3_UNREACHABLE_RETURN(0);
```
|
|
NULL in C++ is esoteric
|
|
I'm unsure why, but it fails on icc.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20200408T220004Z.log.html.gz
```
In file included from ../../.././include/ruby/3/core.h(32),
from ../../.././include/ruby/ruby.h(28),
from cxxanyargs.cpp(1):
../../.././include/ruby/3/core/rtypeddata.h(163): error: return value type does not match the function type
RUBY3_UNREACHABLE_RETURN(NULL);
```
|
|
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 */
```
|
|
RUBY3_CAST is a macro to suppress g++/clang++ warnings about C-style
casts. Though Ruby core don't have to bother C++ situations, extension
libraries can benefit from this.
|
|
It turned out that compilation errors in icc were due to their having
broken __has_builtin. Let's just skip such situations.
|
|
|
|
Trying to fix icc breakage:
https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20200408T050004Z.fail.html.gz
It seems the macro had problems when a builtin does not exist for the
target compiler. Force evaluete to 0 then, by adding 0 to the
expression.
|
|
Split ruby.h
Notes:
Merged-By: shyouhei <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3005
|
|
|
|
* Fix a typo
* Fix typos in st.[ch]
Notes:
Merged-By: k0kubun <[email protected]>
|
|
Commit e91c39f1c0f7d5e670266d9593d533fd444957f6 deleted definition of it.
Though I'm not sure if we can delete public API like this, it no longer
works nontheless. Having declaration without definiton is worse than
having nothing at all. Just delete the declartion too.
|
|
This compile-time option has been broken for years (at least since
commit 49369ef17316cd5d5819b038f286e1d951972b52, according to git
bisect). Let's delete codes that no longer works.
Notes:
Merged: https://github.com/ruby/ruby/pull/2925
|
|
Comma at the end of enum is allowed in C since C99. We can use them
internally. However when it comes to extension libraries, they could be
written in different C++ versions. We cannot assume sometihng. Public
headers shall keep compatibilities.
|
|
|
|
This was related to $SAFE, and was deprecated in 2.7. I missed it
earlier when removing the other $SAFE-related code.
Notes:
Merged: https://github.com/ruby/ruby/pull/2899
|
|
|
|
|
|
1. By substituting `n_var` with its initializer, `0 < n_var` is
equivalent to `argc > argi + n_trail`.
2. As `argi` is non-negative, so `argi + n_trail >= n_trail`, and
the above expression is equivalent to `argc > n_trail`.
3. Therefore, `f_last` is always false, and `last_hash` is no
longer used.
Notes:
Merged: https://github.com/ruby/ruby/pull/2873
Merged-By: nobu <[email protected]>
|
|
Creative use of `@copydoc` Doxygen command and abusing its half-broken C
parser let us delete some lines of documentations, while preserving
document coverages.
|
|
C++ keyword `nullptr` represents a null pointer (note also that NULL is
an integer in C++ due to its design flaw). Its type is `std::nullptr_t`,
defined in <cstddef> standard header. Why not support it when the
backend implementation can take a null pointer as an argument.
|
|
|
|
It was unable for rb_define_global_function to take VALUE(*)(int argc,
const VLAUE *argv, VALUE self) -style function. Test added.
|
|
rb_f_notimplement should be accepted for all possible arities.
Test provided for that.
|
|
The `using engine<...snip...>::define;` line already defines this
function. We don't have to repeat.
|
|
Add missing `*`.
|