diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-03-04 08:46:37 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-03-04 08:50:07 +0200 |
commit | f91b19e696794204f2ba05587eb0dc0475c65345 (patch) | |
tree | 5bb5b56639bc4c87c87e12ad30e06dbd722fffd7 /src | |
parent | 90b1ab9fcdbe3b36b09d9adb5d9517686a020ae4 (diff) | |
download | cflow-f91b19e696794204f2ba05587eb0dc0475c65345.tar.gz cflow-f91b19e696794204f2ba05587eb0dc0475c65345.tar.bz2 |
Fix handling of such declarations as "struct x *a, *b";
* src/parser.c (fake_struct)
(parse_variable_declaration): Correctly determine end of type.
* tests/decl01.at: New test case.
* tests/Makefile.am: Add new test.
* tests/testsuite.at (CFLOW_CHECK_PROG): Don't add extra newline
at the end of expout. All uses updated.
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parser.c b/src/parser.c index 6860828..4126145 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,5 +1,5 @@ /* This file is part of GNU cflow - Copyright (C) 1997, 2005-2007, 2009-2011, 2014-2015 Sergey Poznyakoff + Copyright (C) 1997, 2005-2007, 2009-2011, 2014-2016 Sergey Poznyakoff GNU cflow is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -670,7 +670,7 @@ fake_struct(Ident *ident) ident->type_end = -1; if (tok.type == STRUCT) { if (nexttoken() == IDENTIFIER) { - ident->type_end = tos; + ident->type_end = curs; } putback(); skip_struct(); @@ -701,7 +701,7 @@ parse_variable_declaration(Ident *ident, int parm) ident->type_end = -1; if (tok.type == STRUCT || tok.type == UNION) { if (nexttoken() == IDENTIFIER) { - ident->type_end = tos; + ident->type_end = curs; } putback(); skip_struct(); |