[Bug objc/47832] New: [4.6 Regression] ObjC errors on structures with flexible data members

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 21 10:33:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47832

           Summary: [4.6 Regression] ObjC errors on structures with
                    flexible data members
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: nicola@gcc.gnu.org, iains@gcc.gnu.org


struct S
{
  int s;
  unsigned char *t[];
};
@interface T
{
  struct S *u;
};
@end
@implementation T
{
};
@end

used to compile just fine in 4.5, but 4.6 rejects this
rh678928.m:14:1: error: instance variable has unknown size

I don't know ObjC enough to say whether this is intentional or not (and whether
ObjC standard actually talks about flexible array members at all).  If flexible
array members should be allowed, then it would just need to make sure the
element type is complete, rather than the array type.

This breaks build of raidem, for original testcase see
http://bugzilla.redhat.com/678928



More information about the Gcc-bugs mailing list