This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [doc patch] coding style: 0 vs. NULL + [patch] Code cleanup: skip.c


> > I find '(first)' OK myself but IIRC Pedro recently in some mail
> > wrote he likes more an explicit NULL comparison there.  Although I
> > cannot find his mail now so I hope I do not put these words in
> > Pedro's mouth.
> 
> Yes, indeed I mentioned it recently somewhere.  Personally, I find
> implicit boolean conversions make the code harder to grok, so I prefer the
> latter.

Same here. I tend to prefer explicit checks. From a purely
accademic, sadistic, theoretical perspective, NULL isn't
required to be zero, is it? The C99 draft I have says...

    expands to an implementation-defined null pointer constant

... and I know some architectures did use nonzero null pointers.

> That's about the same level of badness as '!strcmp(a, b)' to me.

Argh, yes, I hate those :-).

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]