Bug 30943 - Compiling flex++ generated C++ source with -Wall produces warnings
Summary: Compiling flex++ generated C++ source with -Wall produces warnings
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: flex (Show other bugs)
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
Target Milestone: ---
Assignee: Petr Machata
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-03-07 12:54 UTC by Boris Folgmann
Modified: 2015-05-05 01:32 UTC (History)
4 users (show)

Fixed In Version: FC-4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-02 18:02:40 UTC
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 22:40 UTC, Stas Sergeev
no flags Details
Forgotten piece of a scanner (229 bytes, text/plain)
2002-08-15 23:06 UTC, Stas Sergeev
no flags Details

Description Boris Folgmann 2001-03-07 12:54:41 UTC
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 15:35:37 UTC
This is fixed in the rawhide/beta flex package, AFAIK.

Comment 2 Boris Folgmann 2001-03-07 16:35:57 UTC
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 22:38:21 UTC
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 22:40:14 UTC
Created attachment 70964 [details]
Simple scanner - testcase for a bug

Comment 5 Stas Sergeev 2002-08-15 23:06:31 UTC
Created attachment 70966 [details]
Forgotten piece of a scanner

Comment 6 Bill Nottingham 2004-12-17 22:26:57 UTC
Apologies for this getting lost in the shuffle. Could you try this on
a current release?

Comment 7 Stas Sergeev 2004-12-22 04:26:48 UTC
$ 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 17:14:28 UTC
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.