64bit NULL?

Harti Brandt brandt at fokus.fraunhofer.de
Mon Oct 27 05:49:54 PST 2003


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 at fokus.fraunhofer.de, harti at freebsd.org


More information about the freebsd-standards mailing list