westes / flex

The Fast Lexical Analyzer - scanner generator for lexing in C and C++
Other
3.64k stars 537 forks source link

flex reentrant yylineno uninitialised #60

Open srivasta opened 8 years ago

srivasta commented 8 years ago

Hi,

This bug was reported by a Debian user at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=616099

If you ask for a reentrant scanner with yylineno, nothing initialises yylineno for you. This is not clearly documented AFAICT.

So you have to explictly call yyset_lineno. I think it would be convenient if yylex_init did this for you. Ie, yy_init_globals should clear yylineno.

Manoj libxlu_cfg_l.l.txt

westes commented 8 years ago

Yes, it's correct that yylineno should be set. Thanks for the report.