[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug: yyleng declared as type size_t
From: |
Hans-Bernhard Broeker |
Subject: |
Re: Bug: yyleng declared as type size_t |
Date: |
Tue, 18 Sep 2001 14:28:20 +0200 (MET DST) |
On Tue, 18 Sep 2001, W. L. Estes wrote:
> > Can you think of any reason why 'size_t' would be preferred over 'int' for
> > yyleng?
>
> yyleng is a length and hence will never be negative. ints can be
> negative.
Yep. OTOH, there *are* some existing definitions (POSIX, Single Unix
Spec.) of what 'lex' (and thus, by compatibility, flex) should behave. One
of them is that 'yyleng' is an int, not a size_t. That definition may
look silly by today's standards, but that's what we have.
So, at least in lex compatibility mode, yyleng has to remain 'int', I
think.
--
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.