summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-04-09 12:22:54 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-04-10 16:17:30 +0900
commit4e7d84cf8778b397fd08730def354dca3ba6d76f (patch)
tree3717dc1f6a91d32c2302efb9a094a986105933e5
parent3e92785fd6ec4bf584128fcd255b01ff4448ea2b (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3011
-rw-r--r--include/ruby/3/core/rstring.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/ruby/3/core/rstring.h b/include/ruby/3/core/rstring.h
index 80e997b494..244b90e96c 100644
--- a/include/ruby/3/core/rstring.h
+++ b/include/ruby/3/core/rstring.h
@@ -29,6 +29,7 @@
#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)
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)
}
}
+RUBY3_WARNING_POP()
+
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
static inline long