From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id JAA00154 for ; Tue, 28 May 1996 09:42:37 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id TAA04225; Mon, 27 May 1996 19:35:23 -0400 (EDT) Resent-Date: Mon, 27 May 1996 19:35:23 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960527163604.ZM24288@candle.brasslantern.com> Date: Mon, 27 May 1996 16:36:00 -0700 In-Reply-To: Zoltan Hidvegi "Re: (NULL == 0) ?" (May 28, 12:00am) References: <199605272200.AAA02444@hzoli.ppp.cs.elte.hu> <25534.199605272211@stone.dcs.warwick.ac.uk> In-Reply-To: Zefram "Re: (NULL == 0) ?" (May 27, 11:11pm) Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.514 14may96) To: A.Main@dcs.warwick.ac.uk (Zefram), Zoltan Hidvegi , zsh-workers@math.gatech.edu Subject: Re: (NULL == 0) ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"KG2Y-.0.x11.wmZgn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1205 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On May 28, 12:00am, Zoltan Hidvegi wrote: } Subject: Re: (NULL == 0) ? } } > >A couple of other questions about Unix and C standards: does anything } > >guarantee that a variable is always 8 * sizeof(var) bits long? } > } > Only if a byte is 8 bits long and there are no holes in the integral } > types. This type of holes are very rare, and we assume 8 bit bytes } > elsewhere. I don't think we actually assume this directly anyway. } } It is used to determine the size of buffers to store the string } representation of an integer. Just grep for 'SIZEOF_LONG \* 8'. Hmm, shouldn't params.c be using the DIGBUFSIZ constant from system.h everywhere, rather than [(SIZEOF_LONG * 8) + 4] in spots? } ntype in struct node has to be at least 32 bit long but it is defined to } int. But it would be wasting of memory to use long on systems where int } has 32 bits and long has 64. I don't think that amount of extra memory usage should be of very much concern. How many 64-bit machines with small amounts of RAM or swap would you really expect to encounter? What's the point of having all that address space if you can't use it? On May 27, 11:11pm, Zefram wrote: } Subject: Re: (NULL == 0) ? } } It might be wise to do a configuration check for the smallest type of } at least 32 bits. There are a number of bitfields that could use } this. Sigh. I really hate having to clutter up code with "Int32" typedefs and their ilk. The only place this should really be necessary is in networking code or the like, where you have to use exactly the number of bits that your peer is sending. (Try running an X11 client from a DEC Alpha and displaying on an X11R4 server on some 32-bit machine. Gets ugly fast. Even worse if the server is a Windows 3.1 X server built with 16-bit MSC.) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"