Mail Archives: djgpp/2002/09/28/05:31:37
Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote in message news:<an16kp$mgq$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>...
> > > > 1. "aggregate has a partly bracketed initializer"
>
> Hmm.. yes, on second look, I think I see what this is about. You have
> a an array of structs, where the struct's only element is an array.
> Strictly speaking that's two aggregates inside each other, so you
> would need *two* pairs of {} per struct.
Yes, this fix works fine. Thanks. But second fix ...
> > Any other way to write this part as more portable code ?
>
> Yet another enum, or a special macro to take 4 chars and transform them
> into an int, which I think the coders were assuming this code would do
> for them:
>
> #define FOURCHARS_TO_INT(c1,c2,c3,c4) \
> (((unsigned long) c1 << 24) \
> || ((unsigned long) c2 << 16) \
> || ((unsigned long) c3 << 8) \
> || (unsigned long) c4)
... not works. Or rather works where it is applied - in enum there is
no more warning. But in case statement where entries from enum are
used there is error that tokens from enum have the same value. Any
idea ?
ABX
- Raw text -