Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure on clean checkout #1220

Closed
kant2002 opened this issue Jul 12, 2022 · 1 comment
Closed

Build failure on clean checkout #1220

kant2002 opened this issue Jul 12, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@kant2002
Copy link
Contributor

I have VS2022 installed and only PlatformToolset=v143 only installed. Running build.cmd x64 Debug produce following error

ClCompile:
  All outputs are up-to-date.
  C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31517\bin\HostX64\x64\CL.exe /c /IC:\d\github\CsWinRT\src\packages\Microsoft.Windows.WinMD.1.0.191022.1\build\native\..\..\ /IC:\d\g
  ithub\CsWinRT\src\_build\x64\Debug\cswinrt\obj\ /ZI /JMC /nologo /W4 /WX /diagnostics:column /sdl /MP /Od /D _UNICODE /D UNICODE /D _DEBUG /D "VERSION_NUMBER=\"0.0.0.0\"" /D "VERSION_STRING=\"0.0.0-private.
  0\"" /D NOMINMAX /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /std:c++17 /permissive- /Yu"pch.h" /Fp"C:\d\github\CsWinRT\src\_build\x64\Debug\cswinrt\obj\cswinrt.pch" /Fo"C:\d\g
  ithub\CsWinRT\src\_build\x64\Debug\cswinrt\obj\\" /Fd"C:\d\github\CsWinRT\src\_build\x64\Debug\cswinrt\obj\vc143.pdb" /external:W4 /Gd /TP /FC /errorReport:queue  /bigobj main.cpp
  main.cpp
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): error C2220: the following warning is treated as an error [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): error C2220: the following warning is treated as an error [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): error C2220: the following warning is treated as an error [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): error C2220: the following warning is treated as an error [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): warning C4702: unreachable code [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): warning C4702: unreachable code [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): warning C4702: unreachable code [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): warning C4702: unreachable code [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]
C:\d\github\CsWinRT\src\cswinrt\code_writers.h(208): warning C4702: unreachable code [C:\d\github\CsWinRT\src\cswinrt\cswinrt.vcxproj]

What is puzzling me, is that I clearly see that 4702 warning is disabled here.

throw_invalid("type definition expected");
#pragma warning(disable:4702)
return TResult();

Actually I'm not on main, but on this branch this #1219 but that's not really matter because that's how I force cswinrt.vcprojx use v143.

@kant2002 kant2002 added the bug Something isn't working label Jul 12, 2022
@manodasanW
Copy link
Member

This looks like it is related to the below from https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-170

Use of the warning pragma in the function to change the state of a warning number larger than 4699 only takes effect after the end of the function.

I have a branch that addresses this, brings in your change in PR and your testwinrt change, and addresses a couple other issues. Will have a PR out for it tomorrow. Thanks for bringing this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants