Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 1997 23:40:16 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        jonny@coppe.ufrj.br, phk@FreeBSD.ORG
Cc:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-gnu@FreeBSD.ORG
Subject:   Re: cvs commit: src/gnu/usr.bin/as/config atof-ieee.c src/gnu/usr.bin/ld/rtld         rtld.c src/gnu/usr.bin/man/man man.c
Message-ID:  <199709191340.XAA17971@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>#define quoting(Poul-Henning Kamp)
>//   Many places in the code NULL is used in integer context, where
>//   plain 0 should be used.  This happens to work because we #define
>//   NULL to 0, but is stylistically wrong and can cause problems
>//   for people trying to port bits of code to other environments.
>
>Is there any problem in defining NULL to ((void *)0) ?

Yes, it would require fixing all the code that uses NULL in integer
context, and would hide the opposite problem of misuse of NULL in
non-integer contexts, e.g.,

	void foo(bar) void *bar; { ... }
	...
	foo(NULL);		/* no prototype in scope */

`lint -p' should warn that the arg is inconsistent, but can't do so if
NULL is ((void *)0).

Bruce



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