From owner-cvs-all Tue Jan 9 15:31:13 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 6CD2137B400; Tue, 9 Jan 2001 15:30:40 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id SAA27353; Tue, 9 Jan 2001 18:30:36 -0500 (EST) (envelope-from wollman) Date: Tue, 9 Jan 2001 18:30:36 -0500 (EST) From: Garrett Wollman Message-Id: <200101092330.SAA27353@khavrinen.lcs.mit.edu> To: Mike Smith Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/alpha/include bus.h In-Reply-To: <200101092237.f09MbvJ01112@mass.osd.bsdi.com> References: <200101091817.f09IHng10622@freefall.freebsd.org> <200101092237.f09MbvJ01112@mass.osd.bsdi.com> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < said: > Where a constant is of a known type, one should avoid "UL" in favour of > the real type, eg. (~(bus_addr_t)0). There's too much "long" in the bus > code already. 8( This will cause strange, hard-to-diagnose bugs arising from sign-extension happening at the wrong times, from the wrong bits being trimmed off in various places, etc. Having said that, your example is indeed the right way to express the concept, just not for the reason you state. C89 guarantees that `unsigned long' is the longest integral type. C99 breaks this promise, but we'll probably sweep that under the carpet for all types but file sizes. -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