Menu

flex C++ generation broken

Help
2006-02-24
2012-07-26
  • Nobody/Anonymous

    Hello,

    the C++ mode of flex 2.5.4a is broken. It generates non-ISO conformant C++ code which makes any recent gcc barf.

    The problem seems to be not GnuWin32 specific, but that's I ran into it (full force), so why not save you folks some trouble. Patching is simple though:

    (1) in flex.skl, replace the line "class istream;"
    with these two lines:

    include <iosfwd>

    using namespace std;

    (2) in FlexLexer.h, replace all occurences of "istream" with "std::istream" and ditto "ostream" with "std::ostream"

    This link has some explanation on what goes wrong:
    http://tinyurl.com/m7oet. However the poster only presented part (1) of the patch. I needed (2)
    too to get it to work.

    If somebody tells me how to submit a formal patch, I'll do it (one day).

     
    • Nobody/Anonymous

      Will this ever get fixed? Anyone?

       
      • GnuWin

        GnuWin - 2006-05-28

        In the next release / version of flex.

         
MongoDB Logo MongoDB