summaryrefslogtreecommitdiff
path: root/include/ruby/internal/special_consts.h
AgeCommit message (Collapse)Author
2024-10-23Fix false warning by gcc 14 for aarch64Nobuyoshi Nakada
gcc 14 for aarch64 with `-O3` may emit a false positive warning for a pointer access of `RB_BUILTIN_TYPE` called from `RB_TYPE_P`. `Qfalse` shouldn't get there because of `RB_SPECIAL_CONST_P`, but the optimizer seems to ignore this condition in some cases (`ASSUME` just before the access doesn't seem to have any effect either). Only by reversing the order in `RB_SPECIAL_CONST_P` to compare with 0 first does the warning seem to go away. Notes: Merged: https://github.com/ruby/ruby/pull/11928
2024-08-11Fix sign-conversion warningNobuyoshi Nakada
``` ../../.././include/ruby/internal/special_consts.h:349:36: error: conversion to ‘VALUE’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Werror=sign-conversion] 349 | return RB_SPECIAL_CONST_P(obj) * RUBY_Qtrue; | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ ```
2024-05-28Allow compilation of C extensions with `-Wconversion`Mike Dalessio
C extension maintainers can now compile with this warning option and the Ruby header files will generate no warnings. [Feature #20507]
2022-11-17Refactor RB_SPECIAL_CONST_P (#6759)Takashi Kokubun
Since https://github.com/ruby/ruby/pull/6599, RUBY_IMMEDIATE_MASK also overlaps RUBY_Qnil. Now RB_SPECIAL_CONST_P seems confusing since both RB_IMMEDIATE_P and RB_TEST check for RUBY_Qnil while we only need to check RUBY_Qnil besides RUBY_IMMEDIATE_MASK. I'd like to make this change to make it less confusing. I confirmed that this doesn't change the number of instructions used for the RUBY_Qfalse check on Linux x86_64 GCC and macOS arm64 Clang. Notes: Merged-By: k0kubun <[email protected]>
2022-10-24Use CXX14 to allow constexpr with non-return statementsNick Hengeveld
Co-authored-by: Daniel Colson <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/6626
2022-10-20Define `UNDEF_P` and `NIL_OR_UNDEF_P` [EXPERIMENTAL]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6599
2022-10-20Move "special consts" so `Qundef` and `Qnil` differ just 1 bitNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6599
2022-10-20[DOC] Fix RUBY_SYMBOL_FLAG comment [ci skip]Nobuyoshi Nakada
Upper bits than the least significant 4 bits need not be 0.
2022-10-19Assert for RTEST that Qnil and Qfalse differ just 1 bitNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6589
2021-09-10include/ruby/internal/special_consts.h: add doxygen卜部昌平
Must not be a bad idea to improve documents. [ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-09-10sed -i 's/. They/. They/'卜部昌平
Truly editorial fix for comments. This works better with Emacs' set-justification-full function. [ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/4815
2020-05-11sed -i 's|ruby/impl|ruby/internal|'卜部昌平
To fix build failures. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-05-11mv include/ruby/{impl,internal}卜部昌平
Devs do not love "impl". Notes: Merged: https://github.com/ruby/ruby/pull/3079