From owner-cvs-all Thu Jan 11 8: 1: 3 2001 Delivered-To: cvs-all@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 6D47E37B400; Thu, 11 Jan 2001 08:00:38 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id LAA46391; Thu, 11 Jan 2001 11:00:30 -0500 (EST) (envelope-from wollman) Date: Thu, 11 Jan 2001 11:00:30 -0500 (EST) From: Garrett Wollman Message-Id: <200101111600.LAA46391@khavrinen.lcs.mit.edu> To: Warner Losh Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/alpha/include bus.h In-Reply-To: <200101110542.f0B5g9s69778@harmony.village.org> References: <20010111163029.B91242@gsmx07.alcatel.com.au> <200101100441.f0A4f2s58670@harmony.village.org> <200101110542.f0B5g9s69778@harmony.village.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.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