From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <8e077f5ac8522f068a77a6d94d27794f@quanstro.net> To: 9fans@9fans.net From: erik quanstrom Date: Thu, 4 Dec 2008 10:16:26 -0500 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] initialization of anonymous structs. Topicbox-Message-UUID: 58f709f6-ead4-11e9-9d60-3106f5b1d025 > On Thu, Dec 4, 2008 at 12:33 PM, Sape Mullender > wrote: >> B bvar = { >> .B = { >> .a1 = 2, >> .b1 = 2, >> }, >> }; > > that doesn't work for me. > i get: > x.c:18 structure element not found B > x.c:18 more initializers than structure: bvar > > changing the .B to .A doesn't work either, nor does > {.A = {.a1 = 3}, .b1 = 4} > which intuitively (without looking at the compiler code) seems the > most likely to work... seems like a subtle compiler nit (i hope i'm not out-of-date again), this initialization does work B bvar = { {.a1 = 1,}, .b1 = 1, }; the {} fix the problem but should not be necessary. - erik