Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: merge bouyer-xenpvh to HEAD



>> vm_guest being an enum, I don't know if the "movl" is correct.  The
>> compiler could make vm_guest an uint8_t.
> Not in C, in C they are int unless the largest enum value forces it
> to a larger type.

"C" is not a single thing.

In C99, that being what I have a reference for, they cannot be larger;
6.7.2.2 says "[#2] The expression that defines the value of an
enumeration constant shall be an integer constant expression that has
a value representable as an int" and [#3] The identifiers in an
enumerator list are declared as constants that have type int ...".

Of particular interest to this question, it also says "[#4] Each
enumerated type shall be compatible with char, a signed integer type,
or an unsigned integer type.  The choice of type is
implementation-defined, but shall be capable of representing the values
of all the members of the enumeration".

So, unless later C specs have changed this _and_ NetBSD is willing to
write off compatability with C as old as C99, I agree with

>> I think it should be switched to a fixed-size type.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index