Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Feb 1997 22:29:37 +0100
From:      "Arne H. Juul" <Arne.Juul@idt.ntnu.no>
To:        eivind@dimaga.com
Cc:        hackers@freebsd.org
Subject:   Re: NULL as ((void*)0) (was Re: strlen() question)
Message-ID:  <199702142129.WAA03375@pat.idt.unit.no>
In-Reply-To: Your message of "Fri, 14 Feb 1997 17:36:53 %2B0100"
References:  <3.0.32.19970214173652.00c0b290@dimaga.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> I hereby propose changing the default declaration of NULL under FreeBSD from
> #define NULL 0
>  to
> #define NULL ((void*)0)
>  for better type-safety and ease of transition to other architechtures
> (e.g. Alpha).   This will probably save us from a quite a few varargs-voes,
> as well as generally making sure the code-base is using NULL correctly,
> which is important for those reading source-code.

This *shouldn't* help.  If it does, the code is broken.
All code should do the right thing with varargs; if having NULL be
plain 0 breaks it, so much the better :-)   Broken code should be
found and fixed, not nurtured.

Ideally one should define NULL to plain 0 sometimes, to
(void *)0  sometimes, and to (1-1)  (or some other bizarre but
legal option) sometimes, just to find bugs in the source tree.

Just IMHO,

  -  Arne H. J.



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