On Wed, Oct 03, 2001 at 04:54:37PM -0400, Roland McGrath wrote: > > On Wed, Oct 03, 2001 at 04:09:37PM -0400, Roland McGrath wrote: > > > > The conversion from signed shorts to unsigned shorts is implementation > > > > defined (or can raise a signal even), so I am out of luck here (unless we > > > > forbid ports higher than 7fff). > > > > > > Say what? Conversions from one bitpattern (integer) type to another > > > bitpattern type of the same size are always fine. > > > > Even cross platform (eg, over the network)? > > You'd better be precise about what you are asking.
Sorry. I mean the following. If we use short to pass io_reg_t, we go from unsigned short to signed short on one architecture, and from signed short to unsigned short on another architecture. It's not clear to me that the bit pattern is preserved if you pass a negative number between two systems with a different representation of negative numbers with MiG (like, the first system uses two's complement and the other uses one's complement). It's not even clear that the first conversion from unsigned short to signed short is valid on every platform. ISO C says that unsigned and signed integer values even with the same size are "different", and conversion from one type to another signed type which can not represant the value in the first type is implementation defined. Thanks, Marcus -- `Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED] Marcus Brinkmann GNU http://www.gnu.org [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.marcus-brinkmann.de _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd