are enums integers in ANSI?
Henry Spencer
henry at utzoo.uucp
Tue Nov 29 07:50:53 AEST 1988
In article <219 at twwells.uucp> bill at twwells.UUCP (T. William Wells) writes:
>: ... In effect, it is allowed to play the hostile
>: adversary, and choose a compatible integral type for this enum other than
>: the one you guessed!
>
>But it does! The standard says that which one it is compatible with
>is "implementation defined". That implies that it has to be
>documented.
Yes, but this is not entirely inconsistent with Dennis's suggestion.
It's quite possible for the documentation to say "picks the first type
from the following list which can hold the values and is not the one used
in any other declaration of this variable: char, int, [...]". Many of
the things which are implementation-defined will have to be documented
as algorithms, not single choices, and there is nothing which forbids
perverse algorithms.
>Furthermore, if we accept that the notion, stated in the Rationale,
>that "implementation defined" does not extend to failing to translate
>the program, applies here, then there has to be at least *one*
>declaration that will work.
No; what we have here is a situation in which the legality of such a
program is implementation-defined. It is not improper to fail to translate
an illegal program.
--
SunOSish, adj: requiring | Henry Spencer at U of Toronto Zoology
32-bit bug numbers. | uunet!attcan!utzoo!henry henry at zoo.toronto.edu
More information about the Comp.std.c
mailing list