bug-grep
[Top][All Lists]
Advanced

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

Use of 0 instead of NULL in src/kwset.c


From: Charles Levert
Subject: Use of 0 instead of NULL in src/kwset.c
Date: Thu, 23 Jun 2005 02:32:33 -0400
User-agent: Mutt/1.4.1i

There are known bugs in src/kwset.c, so I'm
reading the code trying to better understand
what it does and how it does it.  Namely, the
fix Julian proposed for review a few days ago.

I notice this file consistently uses 0 in place
of NULL.  It's the ultimate in C portability,
but I think it makes this code harder to read,
especially since the structures whose pointer
fields are assigned to 0 are not defined anywhere
near where they are used.  Also, some structure
pointers are hidden behind typedef aliases, which
makes it hard to even know they are pointers.

The rest of GNU grep's source code uses NULL
all over the place.  Would anyone be opposed to
a 's/0/NULL/g' switch for these pointer values?
Are there any portability issues that are not
already triggered by the rest of the code?




reply via email to

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