C6319 warnings from WIL header files
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3k
- Forks
- 300
- Avg merge
- 19h 12m
- Merged PRs (30d)
- 1
Description
Using VS 2019 version 16.5.2 (which defaults to /W3 and /permissive-):
- Create a new Console App (C++) Project.
- Install the NuGet package Microsoft.Windows.ImplementationLibrary version 1.0.191107.2.
- Update the .cpp file to use the contents below.
- Build (and maybe wait a minute for warnings analysis to occur).
#include <wil/resource.h>
#include "Windows.h"
BOOL EmulateWin32ApiFailure()
{
SetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}
int main()
{
try
{
THROW_IF_WIN32_BOOL_FALSE(EmulateWin32ApiFailure());
return 0;
}
catch (const wil::ResultException& exception)
{
return exception.GetErrorCode();
}
}
Expected result:
Build succeeds with 0 warnings.
Actual result:
Build succeeds but has 27 warnings for C6319: Use of the comma-operator in a tested expression causes the left argument to be ignored when it has no side-effects.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the warning with the provided Visual Studio 2019 console-app example and inspect the WIL header included through wil/resource.h. Confirm which header or macro produces the C6319 diagnostics, then verify the build completes with zero warnings using the same example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100