This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36446] New: unexplained warning in struct initialization
- From: "geoffrey dot levand at am dot sony dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jun 2008 21:58:25 -0000
- Subject: [Bug c/36446] New: unexplained warning in struct initialization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
/*
gcc -W -c test.c
test.c:18: warning: (near initialization for ?m1.h.b?)
*/
struct h {
int a;
int b;
};
struct m {
struct h h;
int c;
};
struct m m1 = {
.h.a = 1,
.c = 2,
};
struct m m2 = {
.h = {.a = 1},
.c = 2,
};
m1 has that warning, but m2 is ok.
I hit this with both these:
gcc version 4.1.1
gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
-Geoff
--
Summary: unexplained warning in struct initialization
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: geoffrey dot levand at am dot sony dot com
GCC host triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36446