Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maybe_unused to ranges and nodiscard to start_range. #61

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

jrhemstad
Copy link
Contributor

Some compilers issues spurious warnings about unused variables for
instances of scoped_range and unique_range. Use [[maybe_unused]] when available
to silence these warnings.

Likewise, added [[nodiscard]] when available to start_range() to issue a warning
if a user accidently forgets to store the result of start_range(). It is not possible to correctly
use start_range() without using the result to call end_range().

Some compilers issues spurious warnings about unused variables for
instances of scoped_range and unique_range. Use [[maybe_unused]] when available
to silence these warnings.

Likewise, added `[[nodiscard]]` when available to `start_range()` to issue a warning
if a user accidently forgets to store the result of `start_range()`. It is not possible to correctly
use `start_range()` without using the result to call `end_range()`.
And adds NVTX3_NO_DISCARD on all the `get()` singleton functions.
@jrhemstad
Copy link
Contributor Author

Hey @jcohen-nvidia would you mind reviewing this so we can get it merged?

@evanramos-nvidia evanramos-nvidia marked this pull request as draft November 6, 2024 15:38
c/include/nvtx3/nvtx3.hpp Show resolved Hide resolved
c/include/nvtx3/nvtx3.hpp Outdated Show resolved Hide resolved
@evanramos-nvidia evanramos-nvidia marked this pull request as ready for review December 17, 2024 17:20
@evanramos-nvidia evanramos-nvidia merged commit c19ecc1 into NVIDIA:dev Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants