Re: glr2.cc compile errors under Windows
Jot Dot <[email protected]> Sun, 21 Nov 2021 07:21:49 -0700 (MST)
| Newsgroups | gmane.comp.parsers.bison.general |
|---|---|
| Message-ID | <[email protected]> |
>> "You need to compile with the /Zc:__cplusplus switch to see the updated value >> of the __cplusplus macro. We tried updating the macro by default and discovered >> that a lot of code doesn’t compile correctly when we change the value of >> __cplusplus" > No worries. Should I understand that now it works as expected? Ouch. Last night I dissected my code to introduce a major rewrite. For you, I went to a backup and checked. I get the following error only with glr2.cc : 1>D:\data\c\gen - Copy\runtime\scanner.h(35,55): error C2039: 'semantic_type': is not a member of 'gen::Parser' 1>D:\data\c\gen - Copy\runtime\parser.h(122): message : see declaration of 'gen::Parser' ... other irrelevant "Now I'm confused" errors In my scanner.h file I have: #undef YY_DECL #define YY_DECL int gen::Scanner::get_next_token(union gen::Parser::semantic_type& yylval, location& yylloc, Driver* pDriver) This worked for me with everything but glr2. (ie: glr.cc, lalr.cc) Like usual, I'm probably not doing something quite right here. Unless you have an idea, I'll have to check into this later and get back to you. --------------- @Hans - thanks for your input. I just wanted to say this to clarify the problem: To anyone using Microsoft compilers: In MSVC you can get to the properties page for your project and select the C++ version ie: /std:c++17 You'd assume this switch affects the value of __cplusplus but it does not! You have to manually add another switch to tell the compiler to update the __cplusplus value that is reported: This is the /Zc:__cplusplus switch. Otherwise, without the /Zc switch, the compiler will always report __cplusplus as 199711L Thanks everyone