aboutsummaryrefslogtreecommitdiffstats
path: root/compile.h
diff options
context:
space:
mode:
Diffstat (limited to 'compile.h')
-rw-r--r--compile.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/compile.h b/compile.h
index e40517e3d4..ca3c1c96d9 100644
--- a/compile.h
+++ b/compile.h
@@ -211,8 +211,12 @@ r_value(VALUE value)
#define COMPILE_OK 1
#define COMPILE_NG 0
+
+/* leave name uninitialized so that compiler warn if INIT_ANCHOR is
+ * missing */
#define DECL_ANCHOR(name) \
- LINK_ANCHOR name##_body__ = {{0,}, &name##_body__.anchor}; \
- LINK_ANCHOR *name = & name##_body__
+ LINK_ANCHOR *name, name##_body__ = {{0,},}
+#define INIT_ANCHOR(name) \
+ (name##_body__.last = &name##_body__.anchor, name = &name##_body__)
#endif /* RUBY_COMPILE_H */