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
Updated by JosJuice over 5 years ago
- Milestone set to Current
- Relates to maintainability changed from No to Yes
Updated by Billiard26 over 5 years ago
- Status changed from New to Fix pending
Updated by JosJuice over 5 years ago
- Fixed in set to 5.0-10071
Updated by QuellaZhang over 5 years ago
Thanks all of you. Verified on latest version 906ccdb, warning C5054 has gone, but Dolphin failed due to other warning C5055 when build, can you help look at this? If need to open a new issue please let me know.
D:\Dolphin\src\Source\Core\VideoCommon\VertexShaderManager.cpp(83): error C2220: warning treated as error - no 'object' file generated
D:\Dolphin\src\Source\Core\VideoCommon\VertexShaderManager.cpp(83): warning C5055: operator '<=': deprecated between enumerations and floating-point types
D:\Dolphin\src\Source\Core\VideoCommon\VertexShaderManager.cpp(83): 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\VideoCommon\VertexShaderManager.cpp(83): warning C5055: operator '-': deprecated between enumerations and floating-point types
D:\Dolphin\src\Source\Core\VideoCommon\VertexShaderManager.cpp(83): 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\VideoCommon\VertexShaderManager.cpp(84): warning C5055: operator '<=': deprecated between enumerations and floating-point types
D:\Dolphin\src\Source\Core\VideoCommon\VertexShaderManager.cpp(84): 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\VideoCommon\VertexShaderManager.cpp(84): warning C5055: operator '-': deprecated between enumerations and floating-point types
D:\Dolphin\src\Source\Core\VideoCommon\VertexShaderManager.cpp(84): 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
Updated by JosJuice over 5 years ago
Should be fixed by https://github.com/dolphin-emu/dolphin/pull/8051.
Updated by QuellaZhang over 5 years ago
Thank you. The previous warning has not existed with your fix. But as the build time increases, more warnings are triggered. I provided a detailed build log(see attachment), not sure if there are more, if so, I will also provide the log.
Updated by JosJuice over 5 years ago
- Status changed from Fixed to Accepted
Reopening until all warnings of this type are fixed.
Updated by JosJuice over 5 years ago
https://github.com/dolphin-emu/dolphin/pull/8056 should fix the most recent warnings.
Updated by JosJuice over 5 years ago
That PR has been merged now. Could you test again?
Updated by QuellaZhang over 5 years ago
- File dophin_log_x64_build.log dophin_log_x64_build.log added
One error, see attachment.
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(376,39): warning C5054: operator '|': deprecated between enumerations of different types [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(376,39): warning C5054: const u8 type = LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE; [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(376,39): warning C5054: ^ [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(386,39): warning C5054: operator '|': deprecated between enumerations of different types [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(386,39): warning C5054: const u8 type = LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE; [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(386,39): warning C5054: ^ [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(407,39): warning C5054: operator '|': deprecated between enumerations of different types [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(407,39): warning C5054: const u8 type = LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE; [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
D:\Dolphin\src\Source\Core\Core\IOS\USB\Bluetooth\BTReal.cpp(407,39): warning C5054: ^ [D:\Dolphin\src\Source\Core\Core\Core.vcxproj] ^ [D:\Dolphin\src\Source\Core\Core\Core.vcxproj]
Updated by JosJuice over 5 years ago
Sorry for the inactivity. Those warnings should be fixed by https://dolphin-emu.org/download/dev/674a66aab2fa54c9b4c39a027d1701620fc0bafa/. Could you re-test?
Updated by Billiard26 about 5 years ago
- Status changed from Accepted to Fixed
No response. Assuming fixed.
Updated by JosJuice about 5 years ago
- Fixed in changed from 5.0-10071 to 5.0-10850