Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2001 11:00:30 -0500 (EST)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        Warner Losh <imp@harmony.village.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/alpha/include bus.h 
Message-ID:  <200101111600.LAA46391@khavrinen.lcs.mit.edu>
In-Reply-To: <200101110542.f0B5g9s69778@harmony.village.org>
References:  <20010111163029.B91242@gsmx07.alcatel.com.au> <200101100441.f0A4f2s58670@harmony.village.org> <Pine.BSF.4.21.0101092200070.2888-100000@beppo.feral.com> <200101110542.f0B5g9s69778@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Wed, 10 Jan 2001 22:42:09 -0700, Warner Losh <imp@harmony.village.org> said:

> : 	foo = bar & ~0;

> Likely because ~0 is signed, and signed extended in the promotion from
> int to unsigned long.

Exactly so.  Because `long' and `int' are different sizes on Alpha,
the C promotion rules call for promotion first to `long' (by sign
extension) and only then to `unsigned long'.

AFAIR, if Matt had written `~0u', to make the zero unsigned (int), it
would not have been sign-extended, although it's possible to specify
an architecture where the same rules would cause sign-extension in
that case.

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101111600.LAA46391>