Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 2003 09:36:08 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        standards@freebsd.org
Subject:   Re: 64-bit NULL: a followup
Message-ID:  <20031129173608.GA40606@dhcp01.pn.xcllnt.net>
In-Reply-To: <20031130003519.M1415@gamplex.bde.org>
References:  <20031129005823.GA20090@dhcp01.pn.xcllnt.net> <20031129161509.J4841@gamplex.bde.org> <20031129055619.GA48381@dhcp01.pn.xcllnt.net> <20031130003519.M1415@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 30, 2003 at 12:40:41AM +1100, Bruce Evans wrote:
> >
> > The bogusness doesn't increase if we're looking at widths. It actually
> > reduces. The FreeBSD runtime is either ILP32 or LP64. Hence, defining
> > NULL as long is better than defining it as int. For those running
> > IP32L64, NULL can trivially be redefined as int.
> 
> It could be MD in all cases to hide bugs in a MD way.

Yes. This corresponds to MD behaviour of gcc. On alpha, amd64 and
sparc64 gcc widens NULL to 64 bit for arguments that have to be
passed on the stack (still in the context of variadic functions).
On ia64 gcc does not do that. The end result is that the use of NULL
(when defined as 0) without cast works for the first 8 arguments,
because those are passed in registers, but fail for all subsequent
arguments. The widening on the other platforms already hide bugs,
but at least create consistent behaviour. On ia64 the behaviour is
inconsistent, but AFAICT correct from a standards point of view.
Nonetheless utterly bogus behaviour from usability and portability
points of view.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net



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