Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2003 14:49:51 +0100 (CET)
From:      Harti Brandt <brandt@fokus.fraunhofer.de>
To:        sparc64@freebsd.org, standards@freebsd.org
Subject:   64bit NULL?
Message-ID:  <20031027144140.V63585@beagle.fokus.fraunhofer.de>

next in thread | raw e-mail | index | archive | help

Hi all,

a question came up wether the NULL should be defined as (0L) on sparc.
(Solaris does this). Currently we define NULL as 0. This may cause
problems for function with variable argument lists that expect a
terminating NULL pointer. A prominent example is execl(). Although POSIX
(and our man page) gives the synopsis

	execl(...., (char *)0)

our man pages says that the list must be terminated by a NULL pointer,
POSIX speaks 'null pointer'. According to ISO-C NULL is a symbol that
defines a null pointer so that:

	execl(..., NULL)

appears to be legal, yet will probably cause failure on FreeBSD-sparc64.
Shouldn't we change our NULL definition to

#define	NULL	(0L)

? What would break by this change?

Regards,
harti

-- 
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
brandt@fokus.fraunhofer.de, harti@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031027144140.V63585>