Mail Archives: djgpp/2002/04/08/12:45:30
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.
Right,
MartinS
- Raw text -