microsoft / microsoft/Detours

Feature: Annotate API's with [[nodiscard]] if the compiler supports it.

Open
#170 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help-wanted
Dominant language
C++
Stars
6.4k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

It would be nice if the functions which return values like DetourAttach(..) were marked as [[nodiscard]] to catch bugs where the caller does not properly observe the return value of the operation.

You can feature detect [[nodiscard]] support by using the __has_cpp_attribute(nodiscard) macro.

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 locating the public API declarations for functions that return operation results, including DetourAttach, and review how the project handles compiler feature detection. Use __has_cpp_attribute(nodiscard) to determine support; done means the applicable APIs are conditionally annotated without breaking compilers that lack the attribute.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.