josw@mcvax.uucp (Jos Warmer) (07/25/86)
I think there is an error in the handling of enums
enum color { red, green };
typedef struct {
color col : 1;
int index : 1;
} test;
main() { }
gives the following error message:
"enum.c", line 4: error: non-int field
This is not what I expected after reading the C++ book page 64:
"The name of the enumeration becomes a synonym for int,
not a new type."
So col is an int and should be treated in the same way as index.
Does anyone know a fix or a way of avoiding this error ?
The big problem is that this kind of structure is used in
some of the SUN sunview header files, which can not easily
be changed.
--
Jos Warmer, josw@mcvax.UUCP