]> git.sur5r.net Git - cc65/commitdiff
Fixed flexible array struct members.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 8 Sep 2009 07:55:44 +0000 (07:55 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 8 Sep 2009 07:55:44 +0000 (07:55 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4131 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/declare.c

index 29103dbb12f6519f5538581a972a6defc1106228..9061eb838d989477a57b1821f6ac0c5c2732eaff 100644 (file)
@@ -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) {