From 17cc661336de8ee76a4c1c23e5663252d1e1ddca Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Fri, 4 Jan 2008 11:33:03 -0800 Subject: [PATCH] Squelch useless flex-induced warning messages tested in a gcc-4.2.2 flex-2.5.33 environment --- driver/cflexor.lex | 2 ++ ivlpp/Makefile.in | 2 +- ivlpp/lexor.lex | 2 ++ ivlpp/parse.y | 2 ++ lexor.lex | 4 +++- vpi/sdf_lexor.lex | 1 + vpi/sys_readmem_lex.lex | 2 ++ vvp/lexor.lex | 1 + 8 files changed, 14 insertions(+), 2 deletions(-) diff --git a/driver/cflexor.lex b/driver/cflexor.lex index 4da101db0..181e52330 100644 --- a/driver/cflexor.lex +++ b/driver/cflexor.lex @@ -1,4 +1,6 @@ +%option nounput + %{ /* * Copyright (c) 2001 Stephen Williams (steve@icarus.com) diff --git a/ivlpp/Makefile.in b/ivlpp/Makefile.in index 03fb13ea8..37f565893 100644 --- a/ivlpp/Makefile.in +++ b/ivlpp/Makefile.in @@ -58,7 +58,7 @@ ivlpp@EXEEXT@: $O $(CC) $(LDFLAGS) $O -o ivlpp@EXEEXT@ @EXTRALIBS@ lexor.c: lexor.lex - flex -s -olexor.c $(srcdir)/lexor.lex + flex -olexor.c $(srcdir)/lexor.lex parse.h parse.c: parse.y bison --verbose -t -d -o parse.c $(srcdir)/parse.y diff --git a/ivlpp/lexor.lex b/ivlpp/lexor.lex index 496067097..009d8d190 100644 --- a/ivlpp/lexor.lex +++ b/ivlpp/lexor.lex @@ -158,6 +158,8 @@ static int ma_parenthesis_level = 0; %} %option stack +%option nounput +%option noyy_top_state %x PPINCLUDE %x DEF_NAME diff --git a/ivlpp/parse.y b/ivlpp/parse.y index ff722eef7..38745078e 100644 --- a/ivlpp/parse.y +++ b/ivlpp/parse.y @@ -25,6 +25,8 @@ # include static void yyerror(const char*msg); +extern int yylex (void); + %} %% diff --git a/lexor.lex b/lexor.lex index 08a898e52..cfab39360 100644 --- a/lexor.lex +++ b/lexor.lex @@ -1,5 +1,6 @@ %option never-interactive +%option nounput %{ /* @@ -390,8 +391,9 @@ W [ \t\b\f\r]+ error_count += 1; } /* Final catchall. something got lost or mishandled. */ + /* XXX Should we tell the luser something about the lexical state? */ -. { cerr << yylloc.text << ":" << yylloc.first_line +<*>.|\n { cerr << yylloc.text << ":" << yylloc.first_line << ": error: unmatched character ("; if (isgraph(yytext[0])) cerr << yytext[0]; diff --git a/vpi/sdf_lexor.lex b/vpi/sdf_lexor.lex index f373534f1..cebe3c5c2 100644 --- a/vpi/sdf_lexor.lex +++ b/vpi/sdf_lexor.lex @@ -1,5 +1,6 @@ %option never-interactive +%option nounput %{ /* diff --git a/vpi/sys_readmem_lex.lex b/vpi/sys_readmem_lex.lex index c9a4c18b7..ea34671b0 100644 --- a/vpi/sys_readmem_lex.lex +++ b/vpi/sys_readmem_lex.lex @@ -1,4 +1,6 @@ +%option nounput + %{ /* * Copyright (c) 1999 Stephen Williams (steve@icarus.com) diff --git a/vvp/lexor.lex b/vvp/lexor.lex index e197114c5..8a6769f5e 100644 --- a/vvp/lexor.lex +++ b/vvp/lexor.lex @@ -1,5 +1,6 @@ %option never-interactive +%option nounput %{ /*