gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Re: posible issue on ia64 with va_args.


From: Jan Hudec
Subject: Re: [Gnu-arch-users] Re: posible issue on ia64 with va_args.
Date: Wed, 17 Mar 2004 10:49:49 +0100
User-agent: Mutt/1.5.5.1+cvs20040105i

On Tue, Mar 16, 2004 at 09:26:29 -0500, Stefan Monnier wrote:
> > It happens with some debugging systems (which I believe was the
> > original intent), where they use a tagged NULL pointer so that instead
> > of "Dereferenced NULL <segfault>", you get "Dereferenced NULL from
> > foo.c:63 <segfault>", which can be very useful on occasion.
> 
> Wouldn't that tend to cause problems where
> 
>     assert (NULL
>             ==
>             NULL);
> 
> can fail?

assert (NULL == NULL) can't fail, by definition.

If the compiler uses tagged NULLs, it will implement the comparsion by
a short routine that will check for bit equality and for tagged nulls.

Note, that noone ever guaranteed that:

union {
    void *p;
    long l;
} a, b;

a.p = NULL; b.p = NULL;

assert(a.l == b.l);

Won't fail, even if sizeof(void *) == sizeof(long).

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec 
<address@hidden>

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]