httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: Use of pcalloc()
Date Sat, 19 Jul 1997 22:50:05 GMT
Ben Laurie wrote:
> 
> Jim Jagielski wrote:
> 
> > Alexei Kosut wrote:
> > >
> > > So if the null pointer was, say, six, then (!pointer) would still
> > work,
> > > because 0 would be defined to be 6 (ain't C great?) in pointer
> > > context. However, calloc() would still fill a structure with zero,
> > which,
> > > by way of not being equal to six, is not a null pointer.
> > >
> >
> > But, as far as ANSI is concerned, any integral constant value of 0
> > is defined as being the same as a NULL pointer.
> 
> When coerced/cast to a pointer, yes. Filling with 0 bits bypasses the
> type conversion and is therefore potentially (though not in practice)
> wrong.
> 

But if the space is filled with 0, and then some pointer is
then set to one of those 0 filled slots, then that pointer will
be considered a NULL pointer... or is that not the point?

-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
            "Look at me! I'm wearing a cardboard belt!"

Mime
View raw message