Tracker: Bugs

5 gcc -Wconversion - ID: 3341746
Last Update: Settings changed ( wlestes )

Hello,

I've attached a patch, which would reduce gcc -Wconversion
compiler warnings quite a bit, when compiling flex generated c code.

I disagree a bit with the attitude:
"compiler warnings on flex generated c code are not flex bugs"
When flex is used in a large project, then those warnings
can create quite some noise, and seriously distract attention
from important stuff.

An easy exercise for the attached patch,
is to have a look at flex's own scan.l with
make ; rm scan.c ; make CFLAGS='-O2 -Wconversion'

Regards,
Robert


Robert Larice ( rlar ) - 2011-06-28 12:25:58 PDT

5

Open

Accepted

Will Estes

Running the scanner

None

Public


Comments ( 2 )

Date: 2012-08-09 11:50:29 PDT
Sender: rlar

the following commit:

commit 9ba3187a537d6a58d345f2874d06087fd4050399
Date: Thu May 15 21:11:57 2008 +0000
clean up types; resolves 19619027a537d6a58d345f2874d06087fd4050399

seems to interfere awfully with my patch.

at least the change of type for `yyleng'
from int to yy_size_t (which is unsigned)
is quite serious.

yyleng is part of the user API,
I'm wondering whether this was good to change.

on the master branch I see in flex.skl now:
yy_size_t num_to_read ...
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
which makes me nervous, this might be buggy now.

Please, Whats to do now ?
Robert



Date: 2012-08-08 12:39:31 PDT
Sender: wlestesProject Admin

Your patch partially applied. It's on the git branch bug-3341746 in the
sourceforge flex git repository if you'd like to submit a patch against
that for the rest of the changes you were attempting.

Please let me know.



Attached File ( 1 )

Filename Description Download
0001-remove-type-conversion-warnings-in-flex-generated-c-.patch Download

Changes ( 3 )

Field Old Value Date By
resolution_id None 2012-11-01 04:03:21 PDT wlestes
assigned_to nobody 2012-03-23 10:48:15 PDT wlestes
File Added 416294: 0001-remove-type-conversion-warnings-in-flex-generated-c-.patch 2011-06-28 12:26:01 PDT rlar