g++ just exits without any message, egcs-970910 and egcs-970907
Hildo Biersma
hpp@lunatech.com
Fri Sep 12 06:09:00 GMT 1997
On Sep 12, Torbjorn Lindgren wrote
>
> Is an enum supposed to be 'compatible' with a 'int' or not in C++? It's
> either an error in glibc 2.0.5, egcs or something that will need to be
> 'fixincluded' away :-) If C++ doesn't equate enum with int's the best
> cause of action is probably to file a bug report with the glibc team.
According to the third edition of Stroustrup, an enum should be an
integral data type of at least the size required to store the range of
values. An enum with the range 1..9 should therefore have the size required
to store the values 0..15. (All the values of 0..15 can then be used,
legally, with that enum.)
However, you can always convert this by assignment, or by saying
int(enum-value).
An enum does not have to fit in an integer - it might have the size that
requires a long or even a long long.
I cannot help you with the header file conflicts, as I don't know which
is right.
Regards,
Hildo Biersma / Lunatech Research
More information about the Gcc
mailing list