Caphyon / clang-power-tools

Bringing clang-tidy magic to Visual Studio C++ developers.
http://www.clangpowertools.com
Apache License 2.0
487 stars 57 forks source link

On 2023.6 _MSC_VER recognized incorrectly #1296

Closed SlavaC1 closed 1 year ago

SlavaC1 commented 1 year ago

I'm trying to compile a project on Power Tools 2023.6 and I see that _MSC_VER recognized incorrectly. It is recognized as 1910 when in fact it's 1936, which causing to take incorrect header files from libraries.

mariru27 commented 1 year ago

Hi @SlavaC1,

Thank you for reporting this issue

To continue investigate this problem, please provide us full log from output

Kind regards, Marina

SlavaC1 commented 1 year ago

Attaching the log file. log.txt

Also the header with decisions looks like this:

#if _MSC_VER < 1900
    #include "xlocnum_hack_vs2010-2013.h"
#elif _MSC_VER == 1900
    #include "xlocnum_hack_vs2015.h"
#elif _MSC_VER >= 1910 && _MSC_VER < 1914
    #include "xlocnum_hack_vs2017.h"
#elif _MSC_VER == 1914 // VS 2017 version 15.7
    #include "xlocnum_hack_vs2017_15_7.h"
#elif _MSC_VER >= 1915 && _MSC_VER < 1920 // VS 2017 version 15.8 and higher
    #include "xlocnum_hack_vs2017_15_8.h"
#elif _MSC_VER >= 1920 && _MSC_VER < 1926 // VS 2019 version 16.0 to 16.6
    #include "xlocnum_hack_vs2019.h"
#elif _MSC_VER >= 1927 && _MSC_VER < 1929 // VS 2019 version 16.7 to 16.9
    #include "xlocnum_hack_vs2019_16_7.h"
#elif _MSC_VER >= 1929 && _MSC_VER < 1931 // VS 2019 version 16.10 to 16.11, 1930 is VS 2022
    #include "xlocnum_hack_vs2019_16_10.h"
#elif _MSC_VER >= 1931 && _MSC_VER < 1938 // VS 2022 version 17.1
    #include "xlocnum_hack_vs2022_17_1.h"
mariru27 commented 1 year ago

Do you have the same problem on Clang Power Tools v2023.5.0 (don't forget to disable auto update after reinstalling this version)?

What version of Visual Studio you using?

SlavaC1 commented 1 year ago

Didn't try with older version.

image

SlavaC1 commented 1 year ago

Same issue with 2023.5.0

mariru27 commented 1 year ago

Thank you for quick reply

mariru27 commented 1 year ago

@SlavaC1, you can bypass this problem by changing -fms-compatibility-version value (for example in 19.36)

image

SlavaC1 commented 1 year ago

Thanks a lot! Now it's working. Not very intuitive though...