NULL again (was Re: Patch #2 to Pcomm v1.1)

T. William Wells bill at proxftl.UUCP
Mon Oct 3 15:49:11 AEST 1988


In article <7999 at umn-cs.CS.UMN.EDU> randy at umn-cs.UUCP (Randy Orrison) writes:
: In article <837 at proxftl.UUCP> bill at proxftl.UUCP (T. William Wells) writes:
: |Sorry, but you should reread the postings you appended to your
: |message.  Since NULL may be validly defined as (char *)0 (or void
: |*)0), the comparison *lock_path != NULL could be equivalent to
:                     ^             ^^^^  where'd this come from?

Not only does Pcomm have this in it, but comparisons of integral
types with NULL are all over its code.  Try egrep '\*.*NULL' * to
see what I mean.  Not all the lines resulting are wrong, but
quite a few are.

The moral: don't use NULL unless you are assigning to or
comparing with a character pointer.  Better yet: don't use NULL
at all.

---
Bill

You can still reach me at proxftl!bill
But I'd rather you send to proxftl!twwells!bill



More information about the Comp.sources.bugs mailing list