In message <[email protected]>
          Daniel Silverstone <[email protected]> wrote:

> > +bool global_history_add_internal(const char *url, const struct url_data 
> > *data)
> > +   assert(url && data);
> 
> Assert that they are what?
> 
> Why oh why do people assume NULL == 0 ?  (Oh, I know it *is*, but that doesn't
> mean it's defined to be so)

I'm not sure if I fully understand this comment.  Are you suggesting that
C standard wise this test is not correct ? From C programmer point of
view NULL and a constant 0 are equivalent, always.

> One day, I'm going to design a "Coding style enforcement" header which does
> things like defining true and false to both be non-zero and defines NULL to be
> 0xFFFFFFFF and stuff like that, to force comparisons.

If you do that, then we no longer have a C standard conforming environment
to program in.  Even for architectures where the interal representation
of the null pointer constant is a nonzero bit pattern, NULL has to be
defined as 0 (or (void *)0, in fact any integral constant expresson with
value 0).

And a C99 true/false need to be defined as constant 1/0, you can't change
that and still expect any C99 conforming program remains functional.

John.
-- 
John Tytgat
[email protected]

Reply via email to