64bit NULL?

Harti Brandt brandt at fokus.fraunhofer.de
Mon Oct 27 06:23:19 PST 2003


On Mon, 27 Oct 2003, Tony Finch wrote:

TF>On Mon, Oct 27, 2003 at 02:49:51PM +0100, Harti Brandt wrote:
TF>>
TF>> According to ISO-C NULL is a symbol that
TF>> defines a null pointer so that:
TF>>
TF>> 	execl(..., NULL)
TF>>
TF>> appears to be legal, yet will probably cause failure on FreeBSD-sparc64.
TF>
TF>No, NULL is an implementation-defined null pointer constant, not a null
TF>pointer. The difference is that a null pointer constant is an integer
TF>constant expression that evaluates to zero (optionally cast to void*),
TF>and a null pointer is a null pointer constant converted to a pointer type
TF>(which might involve changes in representation). Therefore using a bare
TF>NULL to terminate the execl argument list is not in general legal.

Thanks, Tony. I found the relevant place (6.3.2.3). This sounds logical.

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