X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: BUG: mixing C constructors and field index fools gcc 2.9.5.2 Date: 8 Apr 2002 10:54:02 GMT Organization: Ericsson Erisoft AB, Sweden Lines: 26 Message-ID: References: <20020406135915 DOT 23603 DOT qmail AT web10701 DOT mail DOT yahoo DOT com> NNTP-Posting-Host: lws256.lu.erisoft.se X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) wrote: : Martin Sylvain wrote: : [...] : > As i'm a lazy coder, i do not feel the need to declare the content of the : > 'lock' component and only want to give a value to 'count', other fields can : > remain zeroes, that's ok for me, so i write : > mySem=(struct kSemaphore){count:1}; : That syntax is wrong, I think. You should have written : mySem = (struct kSemaphore){count = 1}; : ':' indicates bitfields, not field names. Check : info gcc "C Extensions" "labeled elements" Well, I find it in ``info gcc "c ext" designated'' and if I understood that section it should be "mySem = (struct kSemaphore){.count = 1};" and the syntax used by Martin Sylvain should also be supported but obsolete. However it stills fails. Right, MartinS