bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Re : "Pointer arithmetic using Null pointer in gawk-3.1.0 testsuite"


From: Paul Eggert
Subject: Re: Re : "Pointer arithmetic using Null pointer in gawk-3.1.0 testsuite"
Date: 14 Apr 2003 21:18:37 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Olatunji Oluwabukunmi Ruwase <address@hidden> writes:

> I am working on a bounds checking patch to gcc. While testing my
> patch on gawk-3.1.0

Gawk 3.1.2 doesn't have the code that you mentioned, so perhaps the
problem has been fixed.  You might try Gawk 3.1.2 with your bounds
checker to see how it fares.  It's in:
<ftp://ftp.gnu.org/gnu/gawk/gawk-3.1.2.tar.gz>

> <                     char *oldsplit = iop->buf + iop->secsiz;

Just out of curiosity, is iop->secsiz equal to zero when the problem
occurs?

If so, it is a very common C extension that NULL + 0 yields NULL.
I don't know of any architecture of interest to Gawk where this
extension does not hold.

Optionally, I suppose a bounds checker might be especially pedantic
and consider NULL + 0 to be an error.  However, I've used NULL + 0 ==
NULL myself in code that is quite portable in practice.  So I would
prefer a bounds checker that allows NULL + 0 by default, though I
suppose it might be nice to have a --pedantic option that disallows
NULL + 0.




reply via email to

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