lex(1) bug -- lex users BEWARE! - (nf)
kim at enea.UUCP
kim at enea.UUCP
Mon May 7 19:00:17 AEST 1984
#R:burl:-43600:enea:600001:000:583
enea!kim Apr 24 11:03:00 1984
Yes, I was hit by this bug a year ago.
Looking at the output from lex (the version supplied with 4.1bsd)
reveals that the size of 'yytext' and some related areas
are only 200 chars!
Since lex does not check for overflow, the simplest fix is
to increase the buffer size by redefining the symbol YYLMAX.
After discovering the bug, I routinely include the following two lines:
# undef YYLMAX
# define YYLMAX 10000
at the start of each lex program, and then I will get a 'bus error'
only when trying to match an abnormally long string by mistake.
Kim Walden
...mcvax!enea!kim
More information about the Comp.unix.wizards
mailing list