microsoft / microsoft/wil

C6285 warning from result_macros.h

Open
#128 1 comment 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

Let me know if you'd rather just have a single issue tracking all compiler warnings.

Repro follows basic pattern in #124.

#include <wil/resource.h>

int main()
{
    wil::unique_event someEvent{ wil::EventOptions::ManualReset };
}

results in the following warning from result_macros.h, line 4231:
C6285: ( || ) is always a non-zero constant. Did you intend to use the bitwise-and operator?

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 with result_macros.h at line 4231 and compile the minimal wil::unique_event example from the issue, following the basic pattern in #124. Confirm the C6285 warning and trace the expression that produces it; done means the warning is resolved for this repro without changing the intended 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
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.