Bug 55778 - flex isn't gcc-3 compatible
Summary: flex isn't gcc-3 compatible
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: flex
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ngo Than
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-06 15:47 UTC by Han-Wen Nienhuys
Modified: 2008-05-01 15:38 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2001-11-06 15:47:35 UTC


Attachments (Terms of Use)

Description Han-Wen Nienhuys 2001-11-06 15:47:29 UTC
Description of Problem:

Output of the C++ version of Flex is not compatible with G++ 3.

Version-Release number of selected component (if applicable):

flex-2.5.4a-15

How Reproducible:

Create a C++ lexer. The output will contain:

  #ifdef __cplusplus

  #include <stdlib.h>
  class istream;

this causes barfage for g++-3

In file included from /usr/include/FlexLexer.h:47,
                 from out/lexer.cc:240:
/usr/include/g++-v3/backward/iostream.h:36: using directive `istream' 
   introduced ambiguous type `istream'
lexer.ll: In member function `virtual int My_lily_lexer::yylex()':
lexer.ll:497: cannot convert `std::istream*' to `istream*' in assignment
lexer.ll: In member function `void yyFlexLexer::yy_load_buffer_state()':
lexer.ll:1020: cannot convert `istream*' to `std::istream*' in assignment
lexer.ll: In member function `void 
   yyFlexLexer::yy_init_buffer(yy_buffer_state*, std::istream*)':
lexer.ll:1070: cannot convert `std::istream*' to `istream*' in assignment


the fix is to replace 

  class istream;

with

  #include <iostream.h>

Comment 1 Ngo Than 2001-11-06 16:39:46 UTC
It's fixe in flex-2.5.4a-17. You willl find it in next rawhide release.


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