This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Fix for short-enums comparison bug




  In message <14018.60839.325601.426391@cetus.cygnus.com>you write:
  > c89 and c9x say that enumerations have to act like some other integer type.
  > Which integer type is implementation defined, and can vary from enumeration
  > to enumeration, but it has to be capable of representing all the values
  > in the enumeration.
Yes the underlying type must be capable of representing all the values for
the enum.  But does the enum restrict the actual values which can be used
with the expected results?

My quick read of the C++ standard made it appear as if assigning a value that
was not a member of the enum resulted in undefined results.  Is this possibly a
case where C++ and C differ?


jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]