summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-25 23:59:56 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-25 23:59:56 (GMT)
commitde11e472b447df6d45cd2eaa577d0f2f1efd4064 (patch)
tree7b0823cc97bdaa6e5811e8219cce73c72acad2e7 /template
parentfff3fd9a8343f8da566e7629d542da4847d91d02 (diff)
prelude.c.tmpl: get rid of errors with old gcc
* template/prelude.c.tmpl: moved diagnostic pragmas outside prelude_eval() for very old gcc. [ruby-core:84449] [Bug #14234] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template')
-rw-r--r--template/prelude.c.tmpl12
1 files changed, 6 insertions, 6 deletions
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index 72c8c71..11ec71f 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -139,13 +139,13 @@ prelude_prefix_path(VALUE self)
% unless preludes.empty?
#define PRELUDE_STR(n) rb_usascii_str_new_static(prelude_##n.L0, sizeof(prelude_##n))
-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 void
+prelude_eval(VALUE code, VALUE name, int line)
+{
static const rb_compile_option_t optimization = {
TRUE, /* int inline_const_cache; */
TRUE, /* int peephole_optimization; */
@@ -159,9 +159,6 @@ prelude_eval(VALUE code, VALUE name, int line)
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) {
@@ -172,6 +169,9 @@ prelude_eval(VALUE code, VALUE name, int line)
NULL, ISEQ_TYPE_TOP, &optimization));
rb_ast_dispose(ast);
}
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
% end
% if @have_sublib