Correct off-by-one-token error in warning.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 16 Jun 2011 09:31:29 +0000 (11:31 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 16 Jun 2011 09:31:29 +0000 (11:31 +0200)
parser.c

index 504cea8..4fa91c2 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1754,12 +1754,13 @@ static initializer_t *parse_scalar_initializer(type_t *type,
 {
        /* there might be extra {} hierarchies */
        int braces = 0;
-       if (next_if('{')) {
+       if (token.type == '{') {
                if (warning.other)
                        warningf(HERE, "extra curly braces around scalar initializer");
                do {
+                       eat('{');
                        ++braces;
-               } while (next_if('{'));
+               } while (token.type == '{');
        }
 
        expression_t *expression = parse_assignment_expression();