Bug 30943

Summary: Compiling flex++ generated C++ source with -Wall produces warnings
Product: [Retired] Red Hat Linux Reporter: Boris Folgmann <boris>
Component: flexAssignee: Petr Machata <pmachata>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: knweiss, mnewsome, stssppnn, uli42
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: FC-4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-02 18:02:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Simple scanner - testcase for a bug
none
Forgotten piece of a scanner none

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
scanner.
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
flex-2.5.4a-33

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.