help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glr2.cc compile errors under Windows


From: Akim Demaille
Subject: Re: glr2.cc compile errors under Windows
Date: Sun, 21 Nov 2021 14:22:03 +0100

Jot,

> Le 21 nov. 2021 à 13:02, Jot Dot <jotdot@shaw.ca> a écrit :
> 
>>   53 #if defined __cplusplus
>>   54 # define YY_CPLUSPLUS __cplusplus
>>   55 #else
>>   56 # define YY_CPLUSPLUS 199711L
>>   57 #endif
>> 
>> Please check why your compiler does not define __cplusplus.  Compliant 
>> compilers
>> must define it properly so that we can know what version of C++17 we're in.
>> See https://en.cppreference.com/w/cpp/preprocessor/replace#Predefined_macros.
> 
> 
> It is defined. Just not what we think it should be. It is 199711L
> 
> I've never had to check the value of __cplusplus, just if it existed or not.
> After some digging, I found this:
> 
> "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"

Amazing...

> Source: 
> https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
> 
> Without this /Zc switch, the Microsoft compiler seems to default __cplusplus 
> to 199711L
> This switch is not on by default.
> 
> I honestly can't find the words to express how I feel about this.

You did it marvelously though :)

> Sorry to bother you,

No worries.  Should I understand that now it works as expected?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]