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 07:52:19 +0900 |
commit | 414d6cf1d310de8f9eed1263116ad568b05a98ec (patch) | |
tree | 9f8653d272297bbcd12d6143c87aeba015ba7a8d /ext/psych | |
parent | 698dde525ad3df1444276ccd28c6349c81af2a19 (diff) |
[ruby/psych] 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"));
^
```
https://github.com/ruby/psych/commit/aa457443b8
Diffstat (limited to 'ext/psych')
-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 6e58611c3c..0fef173729 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, |