When use in lex-compatible mode, flex generates REJECT and yymore() macros whenever them are used by actions or not.
These leads to warnings when compile generated file with '-Wall' option to compiler:
test.c: In function ‘yylex’:
test.c:876: warning: label ‘find_rule’ defined but not used
parser.l: At top level:
test.c:2073: warning: ‘yy_flex_strlen’ defined but not used
I inspect flex source files, and found in "main.c" next lines:
661 if ( lex_compat )
...
669 /* Don't rely on detecting use of yymore() and REJECT,
670 * just assume they'll be used.
671 */
672 yymore_really_used = reject_really_used = true;
I don't understand why autodetection needed to be disabled, but this also disable (make been ignored) --noreject and --noyymore options.
When remove last 4 lines, everything OK: REJECT and yymore() are not generated and warnings disappear.
Nobody/Anonymous
Generating the scanner
2.5.35
Public
|
Date: 2012-08-07 18:51:17 PDT This has been fixed in the flex codebase and will be included in the next |
| Filename | Description | Download |
|---|---|---|
| parser.l | Some lex-file which produce warnings described | Download |