Relax CIL's rules for when two enumeration types are considered compatible.  Previously CIL considered two enums to be compatible if they were the same enum.
Relax CIL's rules for when two enumeration types are considered
compatible.  Previously CIL considered two enums to be compatible if
they were the same enum.

The C99 standard states that "Each enumerated type shall be compatible
with char, a signed integer type, or an unsigned integer type.  The
choice is implementation defined." [Section 6.7.2.2 paragraph 4]
However, it is not at all clear whether compatibility is assumed to be
transitive, i.e. whether two enums which are compatible with char are
thereby compatible with each other.

GCC appears to use a transitive compatibility rule.  Implementing
exactly this semantics in CIL would require duplicating GCC's
internal rules for selecting which primitive scalar type is the
"underlying" representation for any given enum.

MSVC is more relaxed: it considers all enums to be mutually
compatible.  This even extends to enums whose enumeration constants
have values that would force them to use distinct integer types for
their underlying representations.

Given that MSVC lets any enums be compatible, and that GCC's rules are
dependent on spooky compiler internals, the best approach for CIL is
to be broadly accepting.  It is consistent with previous CIL
development for it to accept some erroneous programs but to never
reject any correct program.  So CIL's rule has been changed to
consider all enums to be pairwise compatible.

samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c