Bug 30943 - Compiling flex++ generated C++ source with -Wall produces warnings
Compiling flex++ generated C++ source with -Wall produces warnings
Product: Red Hat Linux
Classification: Retired
Component: flex (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Petr Machata
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-03-07 07:54 EST by Boris Folgmann
Modified: 2015-05-04 21:32 EDT (History)
4 users (show)

See Also:
Fixed In Version: FC-4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-02 13:02:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Simple scanner - testcase for a bug (2.80 KB, text/plain)
2002-08-15 18:40 EDT, Stas Sergeev
no flags Details
Forgotten piece of a scanner (229 bytes, text/plain)
2002-08-15 19:06 EDT, Stas Sergeev
no flags Details

  None (edit)
Description Boris Folgmann 2001-03-07 07:54:41 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [de] (X11; U; Linux 2.2.17-14 i686)

flex++ generated code doesn't fit to other warning free sources.

Reproducible: Always
Steps to Reproduce:
1.Translate a lex .ll input file with flex++
2.Compile the generated lex.yy.cc source with g++ -Wall
3.Some warnings are produced.

Actual Results:  lex.yy.cc: In method `int yyFlexLexer::yylex ()':
lex.yy.cc:601: warning: label `find_rule' defined but not used
/usr/include/g++-3/stl_map.h: At top level:
lex.yy.cc:1508: warning: `void *yy_flex_realloc (void *, unsigned int)' 
defined but not used

Expected Results:  No warnings	

I use the map template class and other features of the STL/libstdc++.
Comment 1 Bill Nottingham 2001-03-07 10:35:37 EST
This is fixed in the rawhide/beta flex package, AFAIK.
Comment 2 Boris Folgmann 2001-03-07 11:35:57 EST
No, it isn't. I tried it with flex-2.5.4a-13 from ftp.redhat.com/rawhide. It
produces the same warnings.

Another point: could you add bison++ to the Red Hat distribution? flex++ doesn't
make much sense without bison++. I had to use the Mandrake RPM
bison++-1.21.7-2mdk, but would like to see it full-supported in my favorite
distribution. It's a must for the serious developer.

Comment 3 Stas Sergeev 2002-08-15 18:38:21 EDT
I just wanted to add that this is not fixed in flex-2.5.4a-26.
This warning appears when plain flex is used, not only flex++.
The warning doesn't appear (for me) if I don't use a REJECT directive in the
I'll attach an example of the scanner that exibits the problem.
Comment 4 Stas Sergeev 2002-08-15 18:40:14 EDT
Created attachment 70964 [details]
Simple scanner - testcase for a bug
Comment 5 Stas Sergeev 2002-08-15 19:06:31 EDT
Created attachment 70966 [details]
Forgotten piece of a scanner
Comment 6 Bill Nottingham 2004-12-17 17:26:57 EST
Apologies for this getting lost in the shuffle. Could you try this on
a current release?
Comment 7 Stas Sergeev 2004-12-21 23:26:48 EST
$ flex parser.l
$ cc -c -Wall lex.yy.c
lex.yy.c:1768: warning: 'yy_flex_realloc' defined but not used
$ rpm -q flex

Not a big problem of course.
Comment 8 Fedora Update System 2006-01-13 12:14:28 EST
From User-Agent: XML-RPC

flex-2.5.4a-35.fc4 has been pushed for FC4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.