diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-25 03:29:41 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-25 04:10:50 +0900 |
commit | aa457443b81fb17224a215d14c7c2641930194cd (patch) | |
tree | ac1485011355bd65ca5ddb619d8b9e839e23203e | |
parent | f99523388f35c2d0e32694bdaa0d4f695976ef21 (diff) | |
download | psych-aa457443b81fb17224a215d14c7c2641930194cd.tar.gz |
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"));
^
```
-rw-r--r-- | ext/psych/psych_parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/psych/psych_parser.c b/ext/psych/psych_parser.c index 6e58611..0fef173 100644 --- a/ext/psych/psych_parser.c +++ b/ext/psych/psych_parser.c @@ -80,11 +80,12 @@ static VALUE allocate(VALUE klass) static VALUE make_exception(yaml_parser_t * parser, VALUE path) { size_t line, column; + VALUE ePsychSyntaxError; line = parser->context_mark.line + 1; column = parser->context_mark.column + 1; - VALUE ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError")); + ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError")); return rb_funcall(ePsychSyntaxError, rb_intern("new"), 6, path, |