Re: Can't compile flex/yacc generated code with ANSI C++ Compiler

Martin von Loewis <loewis@informatik.hu-berlin.de>
20 Dec 2001 00:30:36 -0500

          From comp.compilers

Related articles
Can't compile flex/yacc generated code with ANSI C++ Compiler Mario.Sansone@siemens.com (Mario Sansone) (2001-12-15)
Re: Can't compile flex/yacc generated code with ANSI C++ Compiler remove.haberg@matematik.su.se (2001-12-20)
Re: Can't compile flex/yacc generated code with ANSI C++ Compiler loewis@informatik.hu-berlin.de (Martin von Loewis) (2001-12-20)
Re: Can't compile flex/yacc generated code with ANSI C++ Compiler foldy@rmki.kfki.hu (Foldy Lajos) (2001-12-20)
Re: Can't compile flex/yacc generated code with ANSI C++ Compiler mgieseki@uos.de (Martin Gieseking) (2001-12-20)
ANSI and ISO C++ remove.haberg@matematik.su.se (2001-12-20)
| List of all articles for this month |
From: Martin von Loewis <loewis@informatik.hu-berlin.de>
Newsgroups: comp.compilers
Date: 20 Dec 2001 00:30:36 -0500
Organization: Humboldt University Berlin, Department of Computer Science
References: 01-12-070
Keywords: C++, lex
Posted-Date: 20 Dec 2001 00:30:36 EST

"Mario Sansone" <Mario.Sansone@siemens.com> writes:


> I get this error:
> Cannot assign std::basic_istream<char, std::char_traits<char>>* to istream*
> or
> Cannot assign istream* to std::basic_istream<char, std::char_traits<char>>*
>
> what does this mean ?


That really is a C++ question, or likely one specifically on the
SunPRO compiler. This compiler has two sets of iostreams library: the
traditional one, and the standard-conforming one. You must not mix
those two, but the code above shows that you did.


> flex 2.5.4 genrates no ANSI C++ code ??


As an aside, I'd hope that people get used to call the language ISO
C++, instead of calling it ANSI C++ (which is strictly speaking true
as well, but then I should call it DIN C++).


Anyway, it is very likely that flex generates code that uses C++
extensions; it apparently uses iostream.h.


Regards,
Martin


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.