From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14236 invoked by alias); 6 Jun 2008 09:51:38 -0000 Received: (qmail 14132 invoked by uid 48); 6 Jun 2008 09:50:54 -0000 Date: Fri, 06 Jun 2008 09:51:00 -0000 Message-ID: <20080606095054.14131.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/30006] Compound literal in structure initializer causes missing initializer warning to happen In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "he at uninett dot no" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg00247.txt.bz2 ------- 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