This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30006] Compound literal in structure initializer causes missing initializer warning to happen
- From: "he at uninett dot no" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jun 2008 09:50:54 -0000
- Subject: [Bug c/30006] Compound literal in structure initializer causes missing initializer warning to happen
- References: <bug-30006-13638@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from he at uninett dot no 2008-06-06 09:50 -------
Hi,
here is another testcase which I think might have the
same or at least a similar root cause:
struct o {
struct n {
int b;
int a;
} n;
};
const struct o o = {
#ifdef BUG
.n.b = 1
#else
.n = { .b = 1 }
#endif
};
When compiled with "-c -Wextra" with gcc 4.1.3 as found in NetBSD-current,
this will complain about missing initializers if BUG is defined, even though
a C99-style initializer is used, something which I thought should have obviated
the insistence on initializing all the fields of the struct.
--
he at uninett dot no changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |he at uninett dot no
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30006