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

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

Re: Re : bug in gawk-3.1.0


From: Stepan Kasal
Subject: Re: Re : bug in gawk-3.1.0
Date: Thu, 13 Jun 2002 07:10:56 +0000 (UTC)
User-agent: slrn/0.9.6.2 (Linux)

On Wed, 12 Jun 2002 22:47:21 -0700,
Olatunji Oluwabukunmi Ruwase <address@hidden> wrote:
>
> random.c:178: static long randtbl[DEG_3 + 1] = {
> 
> random.c:230: static long *end_ptr = &randtbl[DEG_3 + 1];
> 
> line 230 is clearly an out of range array expression.

Hallo,
        the situation is still the same in the current version of GNU awk.
The file is copied from FreeBSD.

I'd say this is valid pointer arithmetics.  Some people prefer this, even
though you can also write (randtbl + DEG_3 + 1).

It would also be possible to let end_ptr to point to the last element and
instead of
        if (p < end_ptr)
write
        if (p <= end_ptr)

But some people (including me) prefer the end_ptr to point behind the array.

I'd rather say that your checker should rather accomodate to this
common idiom.

Have a nice day,
        Stepan Kasal





reply via email to

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