ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/08/12:45:30

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
Date: 8 Apr 2002 10:54:02 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 26
Message-ID: <a8rssa$9am$1@antares.lu.erisoft.se>
References: <20020406135915 DOT 23603 DOT qmail AT web10701 DOT mail DOT yahoo DOT com> <a8rs60$b9$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
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 <pype_1999 DOT geo AT yahoo DOT com> 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.



- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019