[前][次][番号順一覧][スレッド一覧]

ruby-changes:67088

From: Nobuyoshi <ko1@a...>
Date: Mon, 9 Aug 2021 11:22:12 +0900 (JST)
Subject: [ruby-changes:67088] a14671a6b6 (master): Suppress warnings in C++2a

https://git.ruby-lang.org/ruby.git/commit/?id=a14671a6b6

From a14671a6b6ad69bab443df75a3472575e2cc0dbc Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 8 Aug 2021 17:23:56 +0900
Subject: 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]
---
 eval.c                              | 7 ++++---
 include/ruby/internal/fl_type.h     | 2 +-
 include/ruby/internal/interpreter.h | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/eval.c b/eval.c
index 40beac2..b890c6a 100644
--- a/eval.c
+++ b/eval.c
@@ -42,7 +42,7 @@ NORETURN(static void rb_raise_jump(VALUE, VALUE)); https://github.com/ruby/ruby/blob/trunk/eval.c#L42
 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);
 
-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);
 
 VALUE rb_eLocalJumpError;
@@ -210,13 +210,13 @@ ruby_finalize(void) https://github.com/ruby/ruby/blob/trunk/eval.c#L210
  * @note This function does not raise any exception.
  */
 int
-ruby_cleanup(volatile int ex)
+ruby_cleanup(int ex)
 {
     return rb_ec_cleanup(GET_EC(), ex);
 }
 
 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;
     volatile VALUE errs[2] = { Qundef, Qundef };
@@ -225,6 +225,7 @@ rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex) https://github.com/ruby/ruby/blob/trunk/eval.c#L225
     rb_thread_t *const volatile th0 = th;
     volatile int sysex = EXIT_SUCCESS;
     volatile int step = 0;
+    volatile int ex = ex0;
 
     rb_threadptr_interrupt(th);
     rb_threadptr_check_signal(th);
diff --git a/include/ruby/internal/fl_type.h b/include/ruby/internal/fl_type.h
index 1d570c4..1906133 100644
--- a/include/ruby/internal/fl_type.h
+++ b/include/ruby/internal/fl_type.h
@@ -238,7 +238,7 @@ enum { https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L238
 # pragma deprecated(RUBY_FL_DUPPED)
 #endif
 
-    = RUBY_T_MASK | RUBY_FL_EXIVAR
+    = (int)RUBY_T_MASK | (int)RUBY_FL_EXIVAR
 };
 
 #undef RBIMPL_HAVE_ENUM_ATTRIBUTE
diff --git a/include/ruby/internal/interpreter.h b/include/ruby/internal/interpreter.h
index 29dee60..12e7486 100644
--- a/include/ruby/internal/interpreter.h
+++ b/include/ruby/internal/interpreter.h
@@ -64,7 +64,7 @@ void ruby_show_copyright(void); https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/interpreter.h#L64
 void ruby_init_stack(volatile VALUE*);
 
 int ruby_setup(void);
-int ruby_cleanup(volatile int);
+int ruby_cleanup(int);
 
 void ruby_finalize(void);
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]