zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: A.Main@dcs.warwick.ac.uk (Zefram),
	Zoltan Hidvegi <hzoli@cs.elte.hu>,
	zsh-workers@math.gatech.edu
Subject: Re: (NULL == 0) ?
Date: Mon, 27 May 1996 16:36:00 -0700	[thread overview]
Message-ID: <960527163604.ZM24288@candle.brasslantern.com> (raw)
In-Reply-To: Zoltan Hidvegi <hzoli@cs.elte.hu> "Re: (NULL == 0) ?" (May 28, 12:00am)
In-Reply-To: Zefram <A.Main@dcs.warwick.ac.uk> "Re: (NULL == 0) ?" (May 27, 11:11pm)

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"



      parent reply	other threads:[~1996-05-27 23:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-25 14:38 clwords bugfix Zefram
1996-05-25 18:02 ` Richard Coleman
1996-05-25 20:52   ` Zefram
1996-05-25 21:25     ` (NULL == 0) ? Richard Coleman
1996-05-25 22:00       ` Zefram
1996-05-27  0:00         ` Zoltan Hidvegi
1996-05-27  6:39           ` Bart Schaefer
1996-05-27  7:29             ` anthony baxter
1996-05-27 13:07           ` Zefram
1996-05-27 22:00             ` Zoltan Hidvegi
1996-05-27 22:11               ` Zefram
1996-05-27 22:41                 ` Zoltan Hidvegi
1996-05-27 22:54                   ` Zefram
1996-05-28  4:54                     ` Bart Schaefer
1996-05-27 23:36                 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=960527163604.ZM24288@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=A.Main@dcs.warwick.ac.uk \
    --cc=hzoli@cs.elte.hu \
    --cc=schaefer@nbn.com \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).