Skip to content

Commit aa45744

Browse files
committed
Get rid of C90 feature
For ruby 2.6 and earlier. https://travis-ci.org/ruby/psych/jobs/562435717#L245-L248 ``` ../../../../ext/psych/psych_parser.c: In function ‘make_exception’: ../../../../ext/psych/psych_parser.c:87:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] VALUE ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError")); ^ ```
1 parent f995233 commit aa45744

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/psych/psych_parser.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ static VALUE allocate(VALUE klass)
8080
static VALUE make_exception(yaml_parser_t * parser, VALUE path)
8181
{
8282
size_t line, column;
83+
VALUE ePsychSyntaxError;
8384

8485
line = parser->context_mark.line + 1;
8586
column = parser->context_mark.column + 1;
8687

87-
VALUE ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
88+
ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
8889

8990
return rb_funcall(ePsychSyntaxError, rb_intern("new"), 6,
9091
path,

0 commit comments

Comments
 (0)