[Bug c/13287] New: Union with anonymous struct as member in gcc3.3

zhixingr at hotmail dot com gcc-bugzilla@gcc.gnu.org
Wed Dec 3 23:15:00 GMT 2003


I just get a program with gcc3.3 in MAC. The simplified test case as following: 
( note the struct inside union is anonymous)

union A{
   struct B{
      int x;
   };
};

int main() {

union A aa;
aa.x = 10;     
return 0;
}

In MAC using gcc 3.3, get the error:

jamesren% gcc -c t.c
t.c:4: warning: declaration does not declare anything
t.c: In function `main':
t.c:9: error: union has no member named `x'

But it passed with gcc 3.2.

-- 
           Summary: Union with anonymous struct as member in gcc3.3
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zhixingr at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list