Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!uflorida!novavax!twwells!bill From: bill@twwells.com (T. William Wells) Newsgroups: comp.lang.c Subject: Re: LEX rule, anyone??? Message-ID: <1989Dec6.144905.1520@twwells.com> Date: 6 Dec 89 14:49:05 GMT References: <601@vice2utc.chalmers.se> <21108@mimsy.umd.edu> Organization: None, Ft. Lauderdale, FL Lines: 15 In article <21108@mimsy.umd.edu> cml@tove.umd.edu (Christopher Lott) writes: : /* this is a regular expression to match a c comment */ : /* written by cml 890922 (probably not minimal) */ : %% : "/*"([^*]|[*]*[^*/])*[*]+"/" {printf("saw a c comment.\n");} : . {putchar(*yytext);} This breaks if the comment is longer than lex's internal buffer. Moreoever, at least some lex's do *not* check for buffer overflow. Boom. --- Bill { uunet | novavax | ankh | sunvice } !twwells!bill bill@twwells.com