help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

yyless(n) macros


From: Bruce Lilly
Subject: yyless(n) macros
Date: Thu, 28 Nov 2002 14:44:36 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020910

The parameter in the definitions of the yyless macros
produced by flex 2.5.24 (and probably some earlier
versions) is not protected, so e.g. the following leads
to a compilation error:

...
char *c, *s = yytext;
c = strchr(s, ':');
yyless(c - s);

The difference between two pointers of like type is
a valid integral expression; the problem is that the
macro expansion does not enclose the parameter "n" in
parentheses, so an invalid exprssion results from the
macro expansion.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]