I get the warning
warning, -s option given but default rule can be matched
if you google
option given but default rule can be matched
You'll get results of flex homepage and an entry in a man page.
warning, -s option given but default rule can be matched' means that it is possible (perhaps only in a particular start condition) that the default rule (match any single character) is the only one that will match a particular input. Since
-s' was given, presumably this is not intended.
My build file doesnt have a -s option. I wrote
bison -y -d calc1.y
flex calc1.l
gcc code...
How do i fix this warning?
Here is a tiny version of my lex file. This file also triggers the warning
%{
#include "y.tab.h"
%}
%option noyywrap nodefault yylineno
%%
[0-9]+ {
return INTEGER;
}
[-+()=/*{},;\n] { return *yytext; }
[ \t] /* skip whitespace */
[a-zA-Z0-9_]* { printf("lex Unknown character = '%s'", yytext); yyerror("lex Unknown character"); }
%%