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 IAA27414 for ; Tue, 28 May 1996 08:07:26 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id SAA02209; Mon, 27 May 1996 18:00:40 -0400 (EDT) Resent-Date: Mon, 27 May 1996 18:00:40 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199605272200.AAA02444@hzoli.ppp.cs.elte.hu> Subject: Re: (NULL == 0) ? To: A.Main@dcs.warwick.ac.uk (Zefram) Date: Tue, 28 May 1996 00:00:42 +0200 (MET DST) Cc: A.Main@dcs.warwick.ac.uk, zsh-workers@math.gatech.edu In-Reply-To: <20765.199605271307@stone.dcs.warwick.ac.uk> from Zefram at "May 27, 96 02:07:05 pm" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"1F_rE1.0.RY.7OYgn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1197 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > >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'. > > Does any Unix or C standard guarantees that an int always has at > >least 32 bits? > > No. But C guarantees that long is at least 32 bits, so if there's > anywhere we need 32 bits we should change it to use long. I don't know > of anywhere in zsh tht needs fixing in this respect. 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. In hashtable.h it is assumed that sizeof(void*) >= sizeof(long). Zoltan