Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Aug 2002 20:23:29 -0700 (PDT)
From:      Archie Cobbs <archie@dellroad.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Jon Mini <mini@FreeBSD.ORG>, Archie Cobbs <archie@dellroad.org>, obrien@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG
Subject:   Re: NULL
Message-ID:  <200208210323.g7L3NTR04362@arch20m.dellroad.org>
In-Reply-To: <20020821114425.Q26007-100000@gamplex.bde.org> "from Bruce Evans at Aug 21, 2002 12:10:47 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans writes:
> In C, 0 and ((void *)0) are just 2 of many different correct definitions
> of NULL.  They cause different warnings and error in broken code, so
> it may be useful to try compiling with both in an attempt to detect
> more errors.

So my vote is for NULL = "((void *)0)" when compiling C code
(and leaving "0" when compiling C++, which can easily be different).

This will catch such obvious bugs as "strncmp(s, t, NULL)"
which are not caught as it stands now...

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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