summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authordearblue <[email protected]>2020-11-23 21:22:50 +0900
committerdearblue <[email protected]>2020-11-23 21:22:50 +0900
commit3a92a4e3d82bc2b7b07a7d817df824233bb770f7 (patch)
tree437e53dc9963e8bba2e817151ac3b4c78be00c1a /include
parent6f53e2c059450e22db3db030deb8d7caab7fb917 (diff)
downloadmruby-3a92a4e3d82bc2b7b07a7d817df824233bb770f7.tar.gz
mruby-3a92a4e3d82bc2b7b07a7d817df824233bb770f7.zip
Avoid warnings from clang's "-Wembedded-directive"
If it gives clang-11.0 `-Wembedded-directive`, a warning will be reported in `include/mruby/boxing_nan.h`. ``` include/mruby/boxing_nan.h:48:2: warning: embedding a directive within macro arguments has undefined behavior [-Wembedded-directive] include/mruby/boxing_nan.h:52:2: warning: embedding a directive within macro arguments has undefined behavior [-Wembedded-directive] ``` The cause of this is #5117. ref. e993b83c509912f2d90ffece32c969a642f5df01
Diffstat (limited to 'include')
-rw-r--r--include/mruby/boxing_nan.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/mruby/boxing_nan.h b/include/mruby/boxing_nan.h
index 5f99ced6d..05f1d953c 100644
--- a/include/mruby/boxing_nan.h
+++ b/include/mruby/boxing_nan.h
@@ -41,15 +41,14 @@ union mrb_value_ {
uint64_t u;
#ifdef MRB_64BIT
void *p;
+# define BOXNAN_IMMEDIATE_VALUE uint32_t i
+#else
+# define BOXNAN_IMMEDIATE_VALUE union { uint32_t i; void *p; }
#endif
struct {
MRB_ENDIAN_LOHI(
uint32_t ttt;
-#ifdef MRB_64BIT
- ,uint32_t i;
-#else
- ,union { uint32_t i; void *p; };
-#endif
+ ,BOXNAN_IMMEDIATE_VALUE;
)
};
mrb_value value;