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

ruby-changes:60727

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 10 Apr 2020 16:17:53 +0900 (JST)
Subject: [ruby-changes:60727] 4e7d84cf87 (master): ruby3_rstring_getmem: suppres warning

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

From 4e7d84cf8778b397fd08730def354dca3ba6d76f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Thu, 9 Apr 2020 12:22:54 +0900
Subject: ruby3_rstring_getmem: suppres warning

icc warns at this line.

> include/ruby/3/core/rstring.h(126): warning #413: variable "retval" has an uninitialized const field
>           struct RString retval;
>                          ^

This must not be a problem because uninitialized const field is not used
at all.  But the warnings are annoying.  Let us suppress them.

diff --git a/include/ruby/3/core/rstring.h b/include/ruby/3/core/rstring.h
index 80e997b..244b90e 100644
--- a/include/ruby/3/core/rstring.h
+++ b/include/ruby/3/core/rstring.h
@@ -29,6 +29,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/3/core/rstring.h#L29
 #include "ruby/3/dllexport.h"
 #include "ruby/3/fl_type.h"
 #include "ruby/3/value_type.h"
+#include "ruby/3/warning_push.h"
 #include "ruby/assert.h"
 
 #define RSTRING(obj)            RUBY3_CAST((struct RString *)(obj))
@@ -111,6 +112,11 @@ RSTRING_EMBED_LEN(VALUE str) https://github.com/ruby/ruby/blob/trunk/include/ruby/3/core/rstring.h#L112
     return RUBY3_CAST((long)f);
 }
 
+RUBY3_WARNING_PUSH()
+#if RUBY3_COMPILER_IS(Intel)
+RUBY3_WARNING_IGNORED(413)
+#endif
+
 RUBY3_ATTR_PURE_ON_NDEBUG()
 RUBY3_ATTR_ARTIFICIAL()
 static inline struct RString
@@ -130,6 +136,8 @@ ruby3_rstring_getmem(VALUE str) https://github.com/ruby/ruby/blob/trunk/include/ruby/3/core/rstring.h#L136
     }
 }
 
+RUBY3_WARNING_POP()
+
 RUBY3_ATTR_PURE_ON_NDEBUG()
 RUBY3_ATTR_ARTIFICIAL()
 static inline long
-- 
cgit v0.10.2


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

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