From xemacs-m  Sat Jun 21 01:45:11 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id BAA17560
	for <xemacs-beta@xemacs.org>; Sat, 21 Jun 1997 01:45:09 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id IAA18878; Sat, 21 Jun 1997 08:45:07 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: Yet more 64bits lossage
References: <19970621012424.18989@iria.mines.u-nancy.fr> <199706210604.XAA07502@xemacs.eng.sun.com> <19970621082753.50969@iria.mines.u-nancy.fr>
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 21 Jun 1997 08:45:06 +0200
In-Reply-To: Olivier Galibert's message of "Sat, 21 Jun 1997 08:27:53 +0200"
Message-ID: <kiglo445ua5.fsf@jagor.srce.hr>
Lines: 49
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta7) - "Oslo"

Olivier Galibert <Olivier.Galibert@mines.u-nancy.fr> writes:

> On Fri, Jun 20, 1997 at 11:04:35PM -0700, Martin Buchholz wrote:
> > Your patch is not quite correct, since NULL might legally be 
> > #define NULL 0
> > instead of
> > #define NULL ((void *) 0)
> > as it presumably is on SGI's.
> Actually, it's
> #define NULL 0L
> 
> which makes much sense. NULL _should_ be the size of a pointer on
> any reasonable compiler, but we're in the real world :/

No,

#define NULL 0

is sufficient in every ANSI C implementation.

5.2:	How do I get a null pointer in my programs?

A:	According to the language definition, a constant 0 in a pointer
	context is converted into a null pointer at compile time.  That
	is, in an initialization, assignment, or comparison when one
	side is a variable or expression of pointer type, the compiler
	can tell that a constant 0 on the other side requests a null
	pointer, and generate the correctly-typed null pointer value.
	Therefore, the following fragments are perfectly legal:

		char *p = 0;
		if(p != 0)

	(See also question 5.3.)
[...]


The problem with variable-width argument lists is that the compilers
cannot know whether there is an integer context, or a pointer
context.  Thus one should always cast the pointers when calling such
functions:

execlp ("foo", "foo", "-v", (char *)0);

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Silence!" cries Freydag. "I did not call thee in for a consultation!" 
"They are my innards! I will not have them misread by a poseur!"

