ruby-changes:48148
From: kosaki <ko1@a...>
Date: Sat, 21 Oct 2017 21:57:20 +0900 (JST)
Subject: [ruby-changes:48148] kosaki:r60262 (trunk): kill "variable set but not used" warning
kosaki 2017-10-21 21:57:14 +0900 (Sat, 21 Oct 2017) New Revision: 60262 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60262 Log: kill "variable set but not used" warning Currently, scanner.c makes following warning. Fix it. ../../../ext/psych/yaml/scanner.c: In function ?\226?\128?\152yaml_parser_decrease_flow_level?\226?\128?\153: ../../../ext/psych/yaml/scanner.c:1189:23: warning: variable ?\226?\128?\152dummy_key?\226?\128?\153 set but not used [-Wunused-but-set-variable] yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */ Modified files: trunk/ext/psych/yaml/scanner.c Index: ext/psych/yaml/scanner.c =================================================================== --- ext/psych/yaml/scanner.c (revision 60261) +++ ext/psych/yaml/scanner.c (revision 60262) @@ -1186,11 +1186,9 @@ yaml_parser_increase_flow_level(yaml_par https://github.com/ruby/ruby/blob/trunk/ext/psych/yaml/scanner.c#L1186 static int yaml_parser_decrease_flow_level(yaml_parser_t *parser) { - yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */ - if (parser->flow_level) { parser->flow_level --; - dummy_key = POP(parser, parser->simple_keys); + (void)POP(parser, parser->simple_keys); } return 1; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/