microsoft / microsoft/wil

[prefast:Warning]: C6387 (in 'wil::ActivityThreadWatcher::{ctor}')

Open
#291 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

PreFast says 'wil::ActivityThreadWatcher::{ctor}' in include/wil/TraceLogging.h hit issue "'Param(1)' could be '0'."
The following appears to be the offending code:
class ActivityThreadWatcher
{
public:
...
ActivityThreadWatcher(*In details::IFailureCallback pCallback, PCSTR staticContextName) WI_NOEXCEPT :
m_callContext(staticContextName),
m_callbackHolder(pCallback, &m_callContext)
{
}

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 in include/wil/TraceLogging.h at the ActivityThreadWatcher constructor and reproduce the C6387 warning with PreFast. Determine the intended nullability contract for pCallback; done means the warning is resolved without changing the constructor's documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.