[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-standards
Subject:    Re: 64-bit NULL: a followup
From:       Marcel Moolenaar <marcel () xcllnt ! net>
Date:       2003-11-29 17:36:08
[Download RAW message or body]

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
_______________________________________________
freebsd-standards@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-standards
To unsubscribe, send any mail to "freebsd-standards-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic