chiaki ISHIKAWA writes:

> I think 7.2 10 is also relevant here.
>
> --- quote ---
> An expression of arithmetic or enumeration type can be converted
> to an enumeration type explicitly. The
> value is unchanged if it is in the range of enumeration values of
> the enumeration type; otherwise the resulting
> enumeration value is unspecified.
> --- end quote
>
> I take so :
>
> typedef enum { a = 1, b, c = 10 } T;
> T x;

> Anyway, in my example above, a compiler can do anything
> if x = 32 is executed (?).

Note here the "enumeration value" is "unspecified", which I assume
merely means the compiler can choose anything for the value of x.

That might be considerably safer than "undefined behavior" of the
"program".
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to