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

ruby-changes:49443

From: shyouhei <ko1@a...>
Date: Tue, 2 Jan 2018 19:19:35 +0900 (JST)
Subject: [ruby-changes:49443] shyouhei:r61558 (trunk): label as lvalue is a GCCism

shyouhei	2018-01-02 15:41:54 +0900 (Tue, 02 Jan 2018)

  New Revision: 61558

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61558

  Log:
    label as lvalue is a GCCism

  Modified files:
    trunk/regexec.c
    trunk/vm_exec.h
Index: vm_exec.h
===================================================================
--- vm_exec.h	(revision 61557)
+++ vm_exec.h	(revision 61558)
@@ -75,7 +75,7 @@ error ! https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L75
 
 #define LABEL(x)  INSN_LABEL_##x
 #define ELABEL(x) INSN_ELABEL_##x
-#define LABEL_PTR(x) &&LABEL(x)
+#define LABEL_PTR(x) RB_GNUC_EXTENSION(&&LABEL(x))
 
 #define INSN_ENTRY_SIG(insn) \
   if (0) fprintf(stderr, "exec: %s@(%d, %d)@%s:%d\n", #insn, \
@@ -106,7 +106,7 @@ error ! https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L106
 /* for GCC 3.4.x */
 #define TC_DISPATCH(insn) \
   INSN_DISPATCH_SIG(insn); \
-  goto *(void const *)GET_CURRENT_INSN(); \
+  RB_GNUC_EXTENSION_BLOCK(goto *(void const *)GET_CURRENT_INSN()); \
   ;
 
 #else
@@ -115,7 +115,7 @@ error ! https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L115
 #define TC_DISPATCH(insn)  \
   DISPATCH_ARCH_DEPEND_WAY(insns_address_table[GET_CURRENT_INSN()]); \
   INSN_DISPATCH_SIG(insn); \
-  goto *insns_address_table[GET_CURRENT_INSN()]; \
+  RB_GNUC_EXTENSION_BLOCK(goto *insns_address_table[GET_CURRENT_INSN()]); \
   rb_bug("tc error");
 
 
Index: regexec.c
===================================================================
--- regexec.c	(revision 61557)
+++ regexec.c	(revision 61558)
@@ -1461,9 +1461,9 @@ match_at(regex_t* reg, const UChar* str, https://github.com/ruby/ruby/blob/trunk/regexec.c#L1461
 # define CASE(x) L_##x: sbegin = s; OPCODE_EXEC_HOOK;
 # define DEFAULT L_DEFAULT:
 # define NEXT sprev = sbegin; JUMP
-# define JUMP goto *oplabels[*p++]
+# define JUMP RB_GNUC_EXTENSION_BLOCK(goto *oplabels[*p++])
 
-  static const void *oplabels[] = {
+  RB_GNUC_EXTENSION static const void *oplabels[] = {
     &&L_OP_FINISH,               /* matching process terminator (no more alternative) */
     &&L_OP_END,                  /* pattern code terminator (success end) */
 
@@ -4617,4 +4617,3 @@ onig_copy_encoding(OnigEncodingType *to, https://github.com/ruby/ruby/blob/trunk/regexec.c#L4617
 {
   *to = *from;
 }
-

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

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