Skip to content

Commit

Permalink
ruby3_rstring_getmem: suppres warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shyouhei committed Apr 10, 2020
1 parent 3e92785 commit 4e7d84c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/ruby/3/core/rstring.h
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand All @@ -130,6 +136,8 @@ ruby3_rstring_getmem(VALUE str)
}
}

RUBY3_WARNING_POP()

RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
static inline long
Expand Down

0 comments on commit 4e7d84c

Please sign in to comment.