This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13286] New: Union with anonymous struct as member in gcc3.3
- From: "zhixingr at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Dec 2003 23:13:55 -0000
- Subject: [Bug c/13286] New: Union with anonymous struct as member in gcc3.3
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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=13286