Emulator Issues #11692
closedDolphin build failed due to warning C5054 under /std:c++latest(C++20) on MSVC
0%
Description
Dolphin build failed due to warning C5054 under /std:c++latest(C++20) in the development version of Visual C++. Could you help look at this? Thanks in advance! Noted that this issue only found when compiles with unreleased vctoolset, that next release of MSVC will have this behavior.
This is a source issue which will accompany the introduction of [depr.arith.conv.enum]/1
in C++20. The fix would be to either static_cast
SI_TYPE_GC
or SI_GC_STANDARD
to an int
or suppress the warning in the build. See source reference: https://github.com/dolphin-emu/dolphin/blob/dd1fc70d703ab399584df6048f2705c3709a4ecc/Source/Core/Core/HW/SI/SI_Device.h#L45
Repro steps:
- open VS2017 x64 Native tools command tool
- git clone https://github.com/dolphin-emu/dolphin.git D:\Dolphin\src
- cd D:\Dolphin
- msbuild /t:Dolphin /p:Configuration=Release;Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17134.0 .\src\Source\dolphin-emu.sln /m
Failures:
D:\Dolphin\src\Source\Core\Core\HW\SI\SI_Device.h(45): error C2220: warning treated as error - no 'object' file generated
D:\Dolphin\src\Source\Core\Core\HW\SI\SI_Device.h(45): warning C5054: operator '|': deprecated between enumerations of different types
D:\Dolphin\src\Source\Core\Core\HW\SI\SI_Device.h(45): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
D:\Dolphin\src\Source\Core\Core\HW\SI\SI_Device.h(49): warning C5054: operator '|': deprecated between enumerations of different types
D:\Dolphin\src\Source\Core\Core\HW\SI\SI_Device.h(49): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
Files