microsoft / microsoft/wil

wil headers are not code analysis clean

Open
#320 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code-analysis
Dominant language
C++
Stars
3k
Forks
300
Avg merge
19h 12m
Merged PRs (30d)
1

Description

If I include wil in a project and run code analysis it should not flag issues in wil itself. But it does:

[...]\packages\Microsoft.Windows.ImplementationLibrary.1.0.230202.1\include\wil\stl.h(177): warning C6387: 'str' could be '0'. [...]\packages\Microsoft.Windows.ImplementationLibrary.1.0.230202.1\include\wil\result.h(388): warning C6001: Using uninitialized memory '*pNode'. [...]\packages\Microsoft.Windows.ImplementationLibrary.1.0.230202.1\include\wil\win32_helpers.h(464): warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2). [...]\packages\Microsoft.Windows.ImplementationLibrary.1.0.230202.1\include\wil\win32_helpers.h(474): warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the listed code-analysis warnings in include/wil/stl.h, include/wil/result.h, and include/wil/win32_helpers.h. Review the reported locations and verify that the warnings no longer appear when analyzing a project that includes WIL.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.