mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 15:06:10 +02:00
RUBY3_ASSUME: suppress warnings on icc
icc warns side effects for RUBY3_ASSUME like this: > ./include/ruby/3/value_type.h(202): warning #2261: __assume expression with side effects discarded > RUBY3_ASSUME(RB_FLONUM_P(obj)); > ^ Which is a false positive (RB_FLONUM_P has no side effect). It seems there is no way for us to tell icc that a functin is safe inside of __assume. Just suppress the warning instead.
This commit is contained in:
parent
d69c532685
commit
3e92785fd6
Notes:
git
2020-04-10 16:17:56 +09:00
1 changed files with 11 additions and 1 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include "ruby/3/config.h"
|
#include "ruby/3/config.h"
|
||||||
#include "ruby/3/cast.h"
|
#include "ruby/3/cast.h"
|
||||||
#include "ruby/3/has/builtin.h"
|
#include "ruby/3/has/builtin.h"
|
||||||
|
#include "ruby/3/warning_push.h"
|
||||||
|
|
||||||
/** @cond INTERNAL_MACRO */
|
/** @cond INTERNAL_MACRO */
|
||||||
#if RUBY3_COMPILER_SINCE(MSVC, 13, 10, 0)
|
#if RUBY3_COMPILER_SINCE(MSVC, 13, 10, 0)
|
||||||
|
@ -58,7 +59,16 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Wraps (or simulates) `__asume`. */
|
/** Wraps (or simulates) `__asume`. */
|
||||||
#if defined(RUBY3_HAVE___ASSUME)
|
#if RUBY3_COMPILER_SINCE(Intel, 13, 0, 0)
|
||||||
|
# /* icc warnings are false positives. Ignore them. */
|
||||||
|
# /* "warning #2261: __assume expression with side effects discarded" */
|
||||||
|
# define RUBY3_ASSUME(expr) \
|
||||||
|
RUBY3_WARNING_PUSH() \
|
||||||
|
RUBY3_WARNING_IGNORED(2261) \
|
||||||
|
__assume(expr) \
|
||||||
|
RUBY3_WARNING_POP()
|
||||||
|
|
||||||
|
#elif defined(RUBY3_HAVE___ASSUME)
|
||||||
# define RUBY3_ASSUME __assume
|
# define RUBY3_ASSUME __assume
|
||||||
|
|
||||||
#elif RUBY3_HAS_BUILTIN(__builtin_assume)
|
#elif RUBY3_HAS_BUILTIN(__builtin_assume)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue