bug-grep
[Top][All Lists]
Advanced

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

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


From: Julian Foad
Subject: Re: Use of 0 instead of NULL in src/kwset.c
Date: Sun, 03 Jul 2005 20:47:58 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050217

Charles Levert wrote:
There are known bugs in src/kwset.c, so I'm
[...]
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?

I agree and would support such a change. I do not think there are any portability problems. The only concern I have is that you should check whether there are any large patches to this file currently in our patch tracker. If this is likely to invalidate them, it would be nice if you could either hold off this change or provide update versions of such patches. (I don't think we need to worry much about patches that people may have that are not in our tracker.)

- Julian




reply via email to

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