[Flex-help] help needed in the transition from flex 2.59 to 2.6
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Rollastre P. <rol...@gm...> - 2016-10-07 06:45:27
|
Hello list. I looks like there are some changes in the code generated by flex 2.59 and 2.6 (in C++) that break my build. in 2.59 the code in question in the XXXX.lexer.cpp is this: if(!yyin) /*%if-c-only*/ /*%endif*/ /*%if-c++-only*/ yyin=&std::cin; /*%endif*/ if(!yyout) /*%if-c-only*/ /*%endif*/ /*%if-c++-only*/ yyout=&std::cout; /*%endif*/ and in 2.6 is like this: if(!yyin) /*%if-c-only*/ /*%endif*/ /*%if-c++-only*/ yyin.rdbuf(std::cin.rdbuf()); /*%endif*/ if(!yyout) /*%if-c-only*/ /*%endif*/ /*%if-c++-only*/ yyout.rdbuf(std::cout.rdbuf()); /*%endif*/ It turns out that the 2.59 version works fine but the 2.6 doesn't compile because yyin and yyout are pointers. I have searched for a solution for my problem in the list but I couldn't find anything. I also googled and found this http://stackoverflow.com/questions/34438023/openfoam-flex-yyin-rdbufstdcin-rdbuf-error http://htaccess9simo.blogspot.com.es/2015/12/openfoam-flex-yyinrdbufstdcinrdbuf-error.html Which basically workaround the problem by downgrading to 2.59 in the /usr/bin. I already tested this and worked for me too. But I would expect there is a better solution which doesn't require that my build system ships a specific version of flex. Does somebody know what am I doing (or not doing) that causes this problem? Thank you and sorry if the question is already posted, I just couldn't find it! |