From: uz Date: Tue, 8 Sep 2009 07:55:44 +0000 (+0000) Subject: Fixed flexible array struct members. X-Git-Tag: V2.13.0rc1~125 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=331803126fbb7e79c980ce228239537583fb7fed;p=cc65 Fixed flexible array struct members. git-svn-id: svn://svn.cc65.org/cc65/trunk@4131 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/declare.c b/src/cc65/declare.c index 29103dbb1..9061eb838 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -723,8 +723,8 @@ static SymEntry* ParseStructDecl (const char* Name) } /* Add a field entry to the table */ - if (FieldWidth > 0) { - /* Add full byte from the bit offset to the variable offset. + if (FieldWidth > 0) { + /* Add full byte from the bit offset to the variable offset. * This simplifies handling he bit-field as a char type * in expressions. */ @@ -738,7 +738,9 @@ static SymEntry* ParseStructDecl (const char* Name) } } else { AddLocalSym (Decl.Ident, Decl.Type, SC_STRUCTFIELD, StructSize); - StructSize += CheckedSizeOf (Decl.Type); + if (!FlexibleMember) { + StructSize += CheckedSizeOf (Decl.Type); + } } NextMember: if (CurTok.Tok != TOK_COMMA) {