From: Karl S. <kar...@gm...> - 2010-03-11 15:51:11
|
Am getting these warnings in the Windows build: 2>Compiling... 2>lex.yy.c 2>program_lexer.l(327) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data 2>program_lexer.l(331) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data 2>program_lexer.l(335) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data 2>program_lexer.l(339) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data The corresponding lines in program_lexer.l are: {num}?{frac}{exp}? { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } {num}"."/[^.] { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } {num}{exp} { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } {num}"."{exp} { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } I think that we need to add a cast to these four places, e.g.: yylval->real = (float) _mesa_strtod(yytext, NULL); Changing progam_lexer.l requires that lex.yy.c (and others) be regenerated with flex/bison and the generated files committed as well, right? Is there a git trigger that does this, which would be really cool? Or does someone need to run flex/bison manually and commit all the resulting files? If the latter, I don't know the exact process and I'd guess that someone routinely does this. If it is not a huge hassle, can someone add these casts to 7.8 and master? The warnings are no big deal, but the casts do have some value in documenting the implicit conversion. Thanks, Karl |