From d9c76c5bd8c60f488d3decbcd5c2b46108bdba6e Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 25 Dec 2017 02:09:14 +0000 Subject: [PATCH] prelude.c.tmpl: fix optimization options * template/prelude.c.tmpl (prelude_eval): fix optimization options. trace_instruction member has been removed. filled coverage_enabled and debug_level members instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- template/prelude.c.tmpl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl index 2267bc9c46..f755a39d8c 100644 --- a/template/prelude.c.tmpl +++ b/template/prelude.c.tmpl @@ -138,6 +138,10 @@ prelude_prefix_path(VALUE self) static void prelude_eval(VALUE code, VALUE name, int line) { +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic error "-Wmissing-field-initializers" +#endif static const rb_compile_option_t optimization = { TRUE, /* int inline_const_cache; */ TRUE, /* int peephole_optimization; */ @@ -146,10 +150,14 @@ prelude_eval(VALUE code, VALUE name, int line) TRUE, /* int operands_unification; */ TRUE, /* int instructions_unification; */ TRUE, /* int stack_caching; */ - FALSE, /* int trace_instruction; */ TRUE, /* int frozen_string_literal; */ FALSE, /* int debug_frozen_string_literal; */ + FALSE, /* unsigned int coverage_enabled; */ + 0, /* int debug_level; */ }; +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif rb_ast_t *ast = rb_parser_compile_string_path(rb_parser_new(), name, code, line); if (!ast->root) {