[Top][All Lists]

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

Re: bison bug.

From: Akim Demaille
Subject: Re: bison bug.
Date: 30 Dec 2001 16:10:37 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

>>>>> "Hans" == Hans Aberg <address@hidden> writes:

Hans> At 11:23 +0100 2001/12/30, Akim Demaille wrote:
>> ...Now bison has
>> if (nitems >= MAXSHORT) fatal (_("too many items (max %d)"),

Hans> Under STD C, you should #include <limits.h>, and the code can
Hans> then read: if (nitems >= SHRT_MAX) fatal (_("too many items (max
Hans> %d)"), SHRT_MAX);

Hans> (And it can never happen that nitems > SHRT_MAX if nitems is a
Hans> short.)

No, this is wrong.  The limitation must not depend upon the host
running bison, but the least denominator with all the hosts on which
the parsers will be compiled.

Trust the code, people have been thinking about it.

reply via email to

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