From c180e49596bb20aef9c887cf9817e21a7f1e0d2b Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 5 Nov 2013 18:55:22 +0000 Subject: [PATCH] Support empty structs in gengtype gcc/ * gengtype-parse.c (struct_field_seq): Support empty structs. From-SVN: r204411 --- gcc/ChangeLog | 4 ++++ 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 + + * gengtype-parse.c (struct_field_seq): Support empty structs. + 2013-11-05 Uros Bizjak * 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); } -- 2.7.4