Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/check_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ jobs:
exit $fail
working-directory: include

- id: now
run: |
date +"mon=%-m"%n"day=%-d" >> $GITHUB_OUTPUT
env:
TZ: Tokyo/Asia

- id: deprecation
run: |
eval $(sed -n 's/^#define RUBY_API_VERSION_\(MAJOR\|MINOR\) /\1=/p' include/ruby/version.h)
if git --no-pager grep --color -o 'rb_warn_deprecated_to_remove_at('$MAJOR'\.'$MINOR',.*' -- '*.c' >&2; then
false
else
true
fi
continue-on-error: ${{ steps.now.outputs.mon < 12 }}

- name: Check if to generate documents
id: rdoc
run: |
Expand Down
6 changes: 0 additions & 6 deletions complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1778,12 +1778,6 @@ rb_complex_new_polar(VALUE x, VALUE y)
return f_complex_polar(rb_cComplex, x, y);
}

VALUE
rb_complex_polar(VALUE x, VALUE y)
{
return rb_complex_new_polar(x, y);
}

VALUE
rb_Complex(VALUE x, VALUE y)
{
Expand Down
1 change: 1 addition & 0 deletions depend
Original file line number Diff line number Diff line change
Expand Up @@ -13378,6 +13378,7 @@ re.$(OBJEXT): $(top_srcdir)/internal/box.h
re.$(OBJEXT): $(top_srcdir)/internal/class.h
re.$(OBJEXT): $(top_srcdir)/internal/compilers.h
re.$(OBJEXT): $(top_srcdir)/internal/encoding.h
re.$(OBJEXT): $(top_srcdir)/internal/error.h
re.$(OBJEXT): $(top_srcdir)/internal/gc.h
re.$(OBJEXT): $(top_srcdir)/internal/hash.h
re.$(OBJEXT): $(top_srcdir)/internal/imemo.h
Expand Down
22 changes: 0 additions & 22 deletions doc/security/command_injection.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,3 @@ These methods include:
- {\`command` (backtick method)}[rdoc-ref:Kernel#`]
(also called by the expression <tt>%x[command]</tt>).
- IO.popen (when called with other than <tt>"-"</tt>).

Some methods execute a system command only if the given path name starts
with a <tt>|</tt>:

- Kernel.open(command).
- IO.read(command).
- IO.write(command).
- IO.binread(command).
- IO.binwrite(command).
- IO.readlines(command).
- IO.foreach(command).
- URI.open(command).

Note that some of these methods do not execute commands when called
from subclass +File+:

- File.read(path).
- File.write(path).
- File.binread(path).
- File.binwrite(path).
- File.readlines(path).
- File.foreach(path).
26 changes: 0 additions & 26 deletions ext/-test-/cxxanyargs/cxxanyargs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,31 +97,6 @@ struct test_rb_define_hooked_variable {
};
VALUE test_rb_define_hooked_variable::v = Qundef;

namespace test_rb_iterate {
VALUE
iter(VALUE self)
{
return rb_funcall(self, rb_intern("yield"), 0);
}

VALUE
block(RB_BLOCK_CALL_FUNC_ARGLIST(arg, param))
{
return rb_funcall(arg, rb_intern("=="), 1, param);
}

VALUE
test(VALUE self)
{
#ifdef HAVE_NULLPTR
rb_iterate(iter, self, nullptr, self);
#endif

rb_iterate(iter, self, RUBY_METHOD_FUNC(block), self); // old
return rb_iterate(iter, self, block, self); // new
}
}

namespace test_rb_block_call {
VALUE
block(RB_BLOCK_CALL_FUNC_ARGLIST(arg, param))
Expand Down Expand Up @@ -936,7 +911,6 @@ Init_cxxanyargs(void)

test(rb_define_virtual_variable);
test(rb_define_hooked_variable);
test(rb_iterate);
test(rb_block_call);
test(rb_rescue);
test(rb_rescue2);
Expand Down
3 changes: 0 additions & 3 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
**********************************************************************/

#define rb_data_object_alloc rb_data_object_alloc
#define rb_data_typed_object_alloc rb_data_typed_object_alloc

#include "ruby/internal/config.h"
#ifdef _WIN32
# include "ruby/ruby.h"
Expand Down
44 changes: 3 additions & 41 deletions include/ruby/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# include <sys/types.h> /* ssize_t */
#endif

#if RBIMPL_COMPILER_SINCE(MSVC, 13, 0, 0)
#if RBIMPL_COMPILER_IS(MSVC)
# pragma intrinsic(_InterlockedOr)
#elif defined(__sun) && defined(HAVE_ATOMIC_H)
# include <atomic.h>
Expand Down Expand Up @@ -790,22 +790,9 @@ rbimpl_atomic_or(volatile rb_atomic_t *ptr, rb_atomic_t val, int memory_order)
#elif defined(HAVE_GCC_SYNC_BUILTINS)
__sync_or_and_fetch(ptr, val);

#elif RBIMPL_COMPILER_SINCE(MSVC, 13, 0, 0)
#elif RBIMPL_COMPILER_IS(MSVC)
_InterlockedOr(ptr, val);

#elif defined(_WIN32) && defined(__GNUC__)
/* This was for old MinGW. Maybe not needed any longer? */
__asm__(
"lock\n\t"
"orl\t%1, %0"
: "=m"(ptr)
: "Ir"(val));

#elif defined(_WIN32) && defined(_M_IX86)
__asm mov eax, ptr;
__asm mov ecx, val;
__asm lock or [eax], ecx;

#elif defined(__sun) && defined(HAVE_ATOMIC_H)
atomic_or_uint(ptr, val);

Expand All @@ -817,15 +804,6 @@ rbimpl_atomic_or(volatile rb_atomic_t *ptr, rb_atomic_t val, int memory_order)
#endif
}

/* Nobody uses this but for theoretical backwards compatibility... */
#if RBIMPL_COMPILER_BEFORE(MSVC, 13, 0, 0)
static inline rb_atomic_t
rb_w32_atomic_or(volatile rb_atomic_t *var, rb_atomic_t val)
{
return rbimpl_atomic_or(var, val);
}
#endif

RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
Expand Down Expand Up @@ -1031,16 +1009,9 @@ rbimpl_atomic_cas(volatile rb_atomic_t *ptr, rb_atomic_t oldval, rb_atomic_t new
#elif defined(HAVE_GCC_SYNC_BUILTINS)
return __sync_val_compare_and_swap(ptr, oldval, newval);

#elif RBIMPL_COMPILER_SINCE(MSVC, 13, 0, 0)
#elif RBIMPL_COMPILER_IS(MSVC)
return InterlockedCompareExchange(ptr, newval, oldval);

#elif defined(_WIN32)
PVOID *pptr = RBIMPL_CAST((PVOID *)ptr);
PVOID pold = RBIMPL_CAST((PVOID)oldval);
PVOID pnew = RBIMPL_CAST((PVOID)newval);
PVOID pret = InterlockedCompareExchange(pptr, pnew, pold);
return RBIMPL_CAST((rb_atomic_t)pret);

#elif defined(__sun) && defined(HAVE_ATOMIC_H)
return atomic_cas_uint(ptr, oldval, newval);

Expand All @@ -1054,15 +1025,6 @@ rbimpl_atomic_cas(volatile rb_atomic_t *ptr, rb_atomic_t oldval, rb_atomic_t new
#endif
}

/* Nobody uses this but for theoretical backwards compatibility... */
#if RBIMPL_COMPILER_BEFORE(MSVC, 13, 0, 0)
static inline rb_atomic_t
rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t newval)
{
return rbimpl_atomic_cas(var, oldval, newval);
}
#endif

RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_NONNULL((1))
Expand Down
2 changes: 0 additions & 2 deletions include/ruby/backward.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include "ruby/internal/interpreter.h"
#include "ruby/backward/2/attributes.h"

RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY() void rb_clear_constant_cache(void);

/* from version.c */
#if defined(RUBY_SHOW_COPYRIGHT_TO_DIE) && !!(RUBY_SHOW_COPYRIGHT_TO_DIE+0)
# error RUBY_SHOW_COPYRIGHT_TO_DIE is deprecated
Expand Down
27 changes: 0 additions & 27 deletions include/ruby/backward/cxxanyargs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,33 +190,6 @@ rb_define_hooked_variable(const char *q, VALUE *w, std::nullptr_t e, void_type *
/// @name Exceptions and tag jumps
/// @{

// RUBY_CXX_DEPRECATED("by rb_block_call since 1.9")
RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Old way to implement iterators.
/// @param[in] q A function that can yield.
/// @param[in] w Passed to `q`.
/// @param[in] e What is to be yielded.
/// @param[in] r Passed to `e`.
/// @return The return value of `q`.
/// @note `e` can be nullptr.
/// @deprecated This function is obsoleted since long before 2.x era. Do not
/// use it any longer. rb_block_call() is provided instead.
inline VALUE
rb_iterate(onearg_type *q, VALUE w, type *e, VALUE r)
{
rb_block_call_func_t t = reinterpret_cast<rb_block_call_func_t>(e);
return backward::rb_iterate_deprecated(q, w, t, r);
}

#ifdef HAVE_NULLPTR
RUBY_CXX_DEPRECATED("by rb_block_call since 1.9")
inline VALUE
rb_iterate(onearg_type *q, VALUE w, std::nullptr_t e, VALUE r)
{
return backward::rb_iterate_deprecated(q, w, e, r);
}
#endif

RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Call a method with a block.
/// @param[in] q The self.
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/internal/attr/deprecated.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#elif RBIMPL_HAS_ATTRIBUTE(deprecated) /* but not with message. */
# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__))

#elif RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0)
#elif RBIMPL_COMPILER_IS(MSVC)
# define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated msg)

#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(deprecated)
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/internal/attr/forceinline.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* `__forceinline` are mutually exclusive. We have to mimic that behaviour for
* non-MSVC compilers.
*/
#if RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0)
#if RBIMPL_COMPILER_IS(MSVC)
# define RBIMPL_ATTR_FORCEINLINE() __forceinline
#elif RBIMPL_HAS_ATTRIBUTE(always_inline)
# define RBIMPL_ATTR_FORCEINLINE() __attribute__((__always_inline__)) inline
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/internal/attr/noexcept.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#elif defined(__INTEL_CXX11_MODE__)
# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_))

#elif RBIMPL_COMPILER_SINCE(MSVC, 19, 0, 0)
#elif RBIMPL_COMPILER_IS(MSVC)
# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_))

#elif __cplusplus >= 201103L
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/internal/attr/restrict.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* `__has_declspec_attribute()` which involves macro substitution. */

/** Wraps (or simulates) `__declspec(restrict)` */
#if RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0)
#if RBIMPL_COMPILER_IS(MSVC)
# define RBIMPL_ATTR_RESTRICT() __declspec(re ## strict)

#elif RBIMPL_HAS_ATTRIBUTE(malloc)
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/internal/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# define HAVE_VA_ARGS_MACRO
# elif defined(__INTEL_CXX11_MODE__)
# define HAVE_VA_ARGS_MACRO
# elif RBIMPL_COMPILER_SINCE(MSVC, 16, 0, 0)
# elif RBIMPL_COMPILER_IS(MSVC)
# define HAVE_VA_ARGS_MACRO
# else
# /* NG, not known. */
Expand Down
8 changes: 0 additions & 8 deletions include/ruby/internal/core/rdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,6 @@ rb_data_object_make(VALUE klass, RUBY_DATA_FUNC mark_func, RUBY_DATA_FUNC free_f
return result;
}

RBIMPL_ATTR_DEPRECATED(("by: rb_data_object_wrap"))
/** @deprecated This function was renamed to rb_data_object_wrap(). */
static inline VALUE
rb_data_object_alloc(VALUE klass, void *data, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
{
return rb_data_object_wrap(klass, data, dmark, dfree);
}

/** @cond INTERNAL_MACRO */
#define rb_data_object_wrap_0 rb_data_object_wrap
#define rb_data_object_wrap_1 rb_data_object_wrap_warning
Expand Down
12 changes: 0 additions & 12 deletions include/ruby/internal/core/rstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@
# include "ruby/backward.h"
#endif

/**
* @private
*
* @deprecated This macro once was a thing in the old days, but makes no sense
* any longer today. Exists here for backwards compatibility
* only. You can safely forget about it.
*
* @internal
*
* Declaration of rb_struct_ptr() is at include/ruby/backward.h.
*/
#define RSTRUCT_PTR(st) rb_struct_ptr(st)
/** @cond INTERNAL_MACRO */
#define RSTRUCT_LEN RSTRUCT_LEN
#define RSTRUCT_SET RSTRUCT_SET
Expand Down
8 changes: 0 additions & 8 deletions include/ruby/internal/core/rtypeddata.h
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,4 @@ rb_data_typed_object_make(VALUE klass, const rb_data_type_t *type, void **datap,
return result;
}

RBIMPL_ATTR_DEPRECATED(("by: rb_data_typed_object_wrap"))
/** @deprecated This function was renamed to rb_data_typed_object_wrap(). */
static inline VALUE
rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *type)
{
return rb_data_typed_object_wrap(klass, datap, type);
}

#endif /* RBIMPL_RTYPEDDATA_H */
Loading