http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46889
Summary: Missing diagnosis on duplicate struct member with anonymous union Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: hjl.to...@gmail.com [...@gnu-35 delta]$ cat foo.c struct foo { #ifdef BAD int x; #endif union { struct { unsigned long time_stamp; }; struct { int *page; }; }; int *page; }; int * bar (struct foo *x) { return x->page; } [...@gnu-35 delta]$ /usr/gcc-4.6/bin/gcc -S -O2 foo.c [...@gnu-35 delta]$ /usr/gcc-4.6/bin/gcc -S -O2 foo.c -DBAD foo.c:13:7: error: duplicate member ‘page’ [...@gnu-35 delta]$