diff options
author | David Malcolm <dmalcolm@redhat.com> | 2013-11-05 18:55:22 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2013-11-05 18:55:22 +0000 |
commit | c180e49596bb20aef9c887cf9817e21a7f1e0d2b (patch) | |
tree | abee94e1d5b63a3fad0541e871cb30e25bf6d3b4 /gcc | |
parent | 4b632a0635cd031a7c23fcf0e6d3b52ffd9d047d (diff) | |
download | gcc-c180e49596bb20aef9c887cf9817e21a7f1e0d2b.zip gcc-c180e49596bb20aef9c887cf9817e21a7f1e0d2b.tar.gz gcc-c180e49596bb20aef9c887cf9817e21a7f1e0d2b.tar.bz2 |
Support empty structs in gengtype
gcc/
* gengtype-parse.c (struct_field_seq): Support empty structs.
From-SVN: r204411
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/gengtype-parse.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ad90d7..4ff3f05 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2013-11-05 David Malcolm <dmalcolm@redhat.com> + + * gengtype-parse.c (struct_field_seq): Support empty structs. + 2013-11-05 Uros Bizjak <ubizjak@gmail.com> * config/i386/t-rtems (MULTILIB_MATCHES): Fix option typos. diff --git a/gcc/gengtype-parse.c b/gcc/gengtype-parse.c index f480503..8328e3a 100644 --- a/gcc/gengtype-parse.c +++ b/gcc/gengtype-parse.c @@ -730,7 +730,7 @@ declarator (type_p ty, const char **namep, options_p *optsp, ( type bitfield ';' | type declarator bitfield? ( ',' declarator bitfield? )+ ';' - )+ + )* Knows that such declarations must end with a close brace (or, erroneously, at EOF). @@ -744,7 +744,7 @@ struct_field_seq (void) const char *name; bool another; - do + while (token () != '}' && token () != EOF_TOKEN) { ty = type (&opts, true); @@ -787,7 +787,6 @@ struct_field_seq (void) } while (another); } - while (token () != '}' && token () != EOF_TOKEN); return nreverse_pairs (f); } |