Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Aug 2002 16:58:08 -0700 (PDT)
From:      Archie Cobbs <archie@dellroad.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Re: NULL
Message-ID:  <200208212358.g7LNw8l08243@arch20m.dellroad.org>
In-Reply-To: <20020821.173653.57449387.imp@bsdimp.com> "from M. Warner Losh at Aug 21, 2002 05:36:53 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh writes:
> : The patch makes 'make buildworld' and 'make buildkernel KERNCONF=LINT'
> : work for me; fyi I have "NO_WERROR= YES" in /etc/make.conf.
> : 
> : Does anyone have an objection to this patch?
> 
> Yes.  I'm not sure that (void *)0 is the right thing to do.  It can
> cause other problems and mask a different set of bugs, especially when
> you call functions that have no prototype in scope.

Can you elaborate?

Seems like the same is true of "0".. e.g., suppose that pointers
are larger than integers, and you call a variadic function with
"NULL" as one of the extra parameters:

	printf("foo=%p num=%d\n", NULL, 123);

This would get screwed with NULL=0 but work right with NULL=(void *)0.

-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?200208212358.g7LNw8l08243>