On Sun, 2 Apr 2006, Keith Packard wrote: > On Sun, 2006-04-02 at 21:31 +0200, Jan-Benedict Glaw wrote: > > > lex.l: In function ÿÿparse_dataÿÿ: > > lex.l:90: error: ÿÿyytext_ptrÿÿ undeclared (first use in this function) > > lex.l:90: error: (Each undeclared identifier is reported only once > > lex.l:90: error: for each function it appears in.) > > make: *** [lex.o] Error 1 > > I think this is a bug in your version of flex; I'm using standard lex > conventions here. I don't know how to make it work for you. I need something like this to make it work with flex/lex.. The "-l" tells flex to be more traditional. The "clean" rule is obvious. And the "yylineno" is a lot more traditional than yyget_lineno(), which doesn't work for me at all. I think that's some issue with flex' support for re-entrant parsers. Whether it works after this, I dunno. But at least it compiles. Linus --- diff --git a/Makefile b/Makefile index 639353a..c7e04a5 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ GCC_WARNINGS3=-Wnested-externs -fno-stri GCC_WARNINGS=$(GCC_WARNINGS1) $(GCC_WARNINGS2) $(GCC_WARNINGS3) CFLAGS=-O0 -g $(GCC_WARNINGS) YFLAGS=-d +LFLAGS=-l SRCS=gram.y lex.l cvs.h parsecvs.c cvsutil.c revlist.c atom.c revcvs.c git.c @@ -20,4 +21,4 @@ lex.o: lex.c y.tab.h: gram.c clean: - rm -f $(OBJS) y.tab.h gram.c parsecvs + rm -f $(OBJS) y.tab.h gram.c parsecvs lex.c diff --git a/lex.l b/lex.l index 39cafb0..c7833a4 100644 --- a/lex.l +++ b/lex.l @@ -65,8 +65,7 @@ parse_data (int save); \t ; \n ; . { - fprintf (stderr, "%s: (%d) ignoring %c\n", - yyfilename, yyget_lineno (), + fprintf (stderr, "%s: (%d) ignoring %c\n", yyfilename, yylineno, yytext[0]); } %% @@ -146,8 +145,7 @@ lex_date (cvs_number *n) d = mktime (&tm); if (d == 0) { int i; - fprintf (stderr, "%s: (%d) unparsable date: ", yyfilename, - yyget_lineno ()); + fprintf (stderr, "%s: (%d) unparsable date: ", yyfilename, yylineno); for (i = 0; i < n->c; i++) { if (i) fprintf (stderr, "."); fprintf (stderr, "%d", n->n[i]);