1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Suppress warnings in C++2a

* bitwise operation between different enumeration types
  ('ruby_value_type' and 'ruby_fl_type') is deprecated
  [-Wdeprecated-enum-enum-conversion]

* volatile-qualified parameter type 'volatile int' is deprecated
  [-Wdeprecated-volatile]
This commit is contained in:
Nobuyoshi Nakada 2021-08-08 17:23:56 +09:00
parent f584dc5a11
commit a14671a6b6
Notes: git 2021-08-09 11:22:18 +09:00
3 changed files with 6 additions and 5 deletions

7
eval.c
View file

@ -42,7 +42,7 @@ NORETURN(static void rb_raise_jump(VALUE, VALUE));
void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec); void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec);
void rb_ec_clear_all_trace_func(const rb_execution_context_t *ec); void rb_ec_clear_all_trace_func(const rb_execution_context_t *ec);
static int rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex); static int rb_ec_cleanup(rb_execution_context_t *ec, int ex);
static int rb_ec_exec_node(rb_execution_context_t *ec, void *n); static int rb_ec_exec_node(rb_execution_context_t *ec, void *n);
VALUE rb_eLocalJumpError; VALUE rb_eLocalJumpError;
@ -210,13 +210,13 @@ ruby_finalize(void)
* @note This function does not raise any exception. * @note This function does not raise any exception.
*/ */
int int
ruby_cleanup(volatile int ex) ruby_cleanup(int ex)
{ {
return rb_ec_cleanup(GET_EC(), ex); return rb_ec_cleanup(GET_EC(), ex);
} }
static int static int
rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex) rb_ec_cleanup(rb_execution_context_t *ec, int ex0)
{ {
int state; int state;
volatile VALUE errs[2] = { Qundef, Qundef }; volatile VALUE errs[2] = { Qundef, Qundef };
@ -225,6 +225,7 @@ rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex)
rb_thread_t *const volatile th0 = th; rb_thread_t *const volatile th0 = th;
volatile int sysex = EXIT_SUCCESS; volatile int sysex = EXIT_SUCCESS;
volatile int step = 0; volatile int step = 0;
volatile int ex = ex0;
rb_threadptr_interrupt(th); rb_threadptr_interrupt(th);
rb_threadptr_check_signal(th); rb_threadptr_check_signal(th);

View file

@ -238,7 +238,7 @@ enum {
# pragma deprecated(RUBY_FL_DUPPED) # pragma deprecated(RUBY_FL_DUPPED)
#endif #endif
= RUBY_T_MASK | RUBY_FL_EXIVAR = (int)RUBY_T_MASK | (int)RUBY_FL_EXIVAR
}; };
#undef RBIMPL_HAVE_ENUM_ATTRIBUTE #undef RBIMPL_HAVE_ENUM_ATTRIBUTE

View file

@ -64,7 +64,7 @@ void ruby_show_copyright(void);
void ruby_init_stack(volatile VALUE*); void ruby_init_stack(volatile VALUE*);
int ruby_setup(void); int ruby_setup(void);
int ruby_cleanup(volatile int); int ruby_cleanup(int);
void ruby_finalize(void); void ruby_finalize(void);