[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: src/bison/src/location.c:192: poor choice of type for local variable
From: |
Akim Demaille |
Subject: |
Re: src/bison/src/location.c:192: poor choice of type for local variable ? |
Date: |
Wed, 23 Oct 2013 11:08:59 +0200 |
Le 23 oct. 2013 à 10:27, David Binderman <address@hidden> a écrit :
> Hello there,
>
> I just ran static analysis tool "cppcheck" over the source code
> of the latest version of bison.
>
> It said
>
> [src/bison/src/location.c:192]: (warning) Storing getc() return value in char
> variable and then comparing with EOF.
>
> Source code is
>
> char c = getc (caret_info.source);
> if (c != EOF)
>
> The if test will always fail. Suggest change type of local variable c to int.
Hi,
Yes, this is a known (embarrassing…) problem. It has been
fixed already, and Bison 3.0.1 should be released soon.
Thanks!