From 331803126fbb7e79c980ce228239537583fb7fed Mon Sep 17 00:00:00 2001 From: uz Date: Tue, 8 Sep 2009 07:55:44 +0000 Subject: [PATCH] Fixed flexible array struct members. git-svn-id: svn://svn.cc65.org/cc65/trunk@4131 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/declare.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) { -- 2.39.5