Re: [Flex-devel] GCC warning comparing signed and unsigned and possible bug
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Timothy A. <tim...@co...> - 2016-09-15 17:13:15
|
On Thu, 2016-09-15 at 05:17 -0400, Will Estes wrote: > Which version of flex are you using? Looks like you've got an old > version from the filenames you reference. Version 2.6.0. The filenames are from a zipped copy of the source I downloaded from sourceforges cvs system, they should be the latest possible versions. > > On Thursday, 15 September 2016, 11:10 am +1000, Timothy Arceri <timot > hy....@co...> wrote: > > > > > Hi guys, > > > > I'm seeing a GCC waring in the output from lex which seems to be > > caused > > by the following line in flex.skl: > > > > YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE- > > >yy_ch_buf[number_to_move]), > > YY_G(yy_n_chars), num_to_read ); > > > > To fix it should be changed to: > > > > YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE- > > >yy_ch_buf[number_to_move]), > > YY_G(yy_n_chars), (unsigned) num_to_read ); > > > > > > Something else I noticed is there are two flex.skl files, the > > output > > I'm getting seems to be generated by the one > > in flex/to.do/unicode/flex.skl where num_to_read is defined as int > > which is fine. However the one in flex/flex.skl defines num_to_read > > as yy_size_t which is unsigned which means the while loop while ( > > num_to_read <= 0 ) might not get executed, this looks like a bug. > > > > Tim > > > > > > > > ----------------------------------------------------------------- > > ------------- > > _______________________________________________ > > Flex-devel mailing list > > Fle...@li... > > https://lists.sourceforge.net/lists/listinfo/flex-devel > |