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

problem with unput macro in flex



Hi all,

I have a sarge installation with the latest flex package (2.5.31).  There
is a bug with this version of flex that is exposed with this lex
description:

---------------------------------------------------------
%{

%}

NEWLINE [\n]

%%

<INITIAL>"//".*$ {printf("%s",yytext);}

%%

void
test(void)
{
	unput(' ');
}
---------------------------------------------------------

The command line I used is:

$ flex -otst_lex.c tst.l
$ gcc -g -O2 -Wall -c tst_lex.c

I got an error about yytext_ptr undefined.  The generated C code does have
this macro.  But it was undef'ed before the function test() was defined,
so by the time unput() is called, the macro is gone.

I'm not sure whether this is an upstream bug or something only in sarge.
I do know that flex 2.5.4 in woody doesn't have this problem.

--jc
-- 
Jimen Ching (WH6BRR)      jching@flex.com     wh6brr@uhm.ampr.org



Reply to: