Skip to content

Marks conditionally-used params in argument annotation framework [[maybe_unused]]#9225

Merged
davebayer merged 1 commit into
NVIDIA:mainfrom
elstehle:fix/cuda-argument-unused-param-warning
Jun 3, 2026
Merged

Marks conditionally-used params in argument annotation framework [[maybe_unused]]#9225
davebayer merged 1 commit into
NVIDIA:mainfrom
elstehle:fix/cuda-argument-unused-param-warning

Conversation

@elstehle
Copy link
Copy Markdown
Contributor

@elstehle elstehle commented Jun 3, 2026

Marks the conditionally-used parameters of __validate_static_element_bounds and __validate_runtime_element_bounds in the argument annotation framework as [[maybe_unused]]. Those parameters are only referenced inside _CCCL_ASSERT/if constexpr, so they are unused and trip a unused-parameter when the assertions compile out .

@elstehle elstehle requested a review from a team as a code owner June 3, 2026 06:32
@elstehle elstehle requested a review from davebayer June 3, 2026 06:32
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jun 3, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented Jun 3, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jun 3, 2026
@davebayer davebayer enabled auto-merge (squash) June 3, 2026 06:33
@elstehle elstehle force-pushed the fix/cuda-argument-unused-param-warning branch from dd98a83 to 3068abb Compare June 3, 2026 06:35
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1f9b63a9-3678-4a32-9fd5-8c94b17320fe

📥 Commits

Reviewing files that changed from the base of the PR and between 3068abb and b571d2b.

📒 Files selected for processing (1)
  • libcudacxx/include/cuda/__argument/argument.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • libcudacxx/include/cuda/__argument/argument.h

Note: CodeRabbit is enabled on this repository as a convenience for maintainers
and contributors. Use your best judgment when considering its review comments and
suggestions — a suggested change may be inadequate, unnecessary, or safe to ignore.
Contributors are not expected to address every comment. Human reviews are what
ultimately matter for merging.

Summary

This PR marks conditionally-used parameters in the argument annotation framework with the [[maybe_unused]] attribute to suppress unused-parameter compiler warnings.

Changes

File: libcudacxx/include/cuda/__argument/argument.h

  • __validate_static_element_bounds: Added [[maybe_unused]] to the __val parameter
  • __validate_runtime_element_bounds: Added [[maybe_unused]] to both the __val and __runtime_bounds parameters; function signature reformatted across multiple lines

Rationale

The parameters of both validation functions are referenced only inside _CCCL_ASSERT / if constexpr contexts. When assertions are compiled out, these parameters become unused and trigger compiler warnings. The [[maybe_unused]] attribute suppresses these warnings while preserving the function signatures and logic.

Walkthrough

suggestion: This PR adds [[maybe_unused]] annotations to parameters in two internal validation helper functions in the argument header. The __validate_static_element_bounds and __validate_runtime_element_bounds functions have their parameters marked to suppress unused-parameter warnings.

Changes

Validation helper parameter annotations

Layer / File(s) Summary
Add [[maybe_unused]] annotations to validation helpers
libcudacxx/include/cuda/__argument/argument.h
__validate_static_element_bounds marks __val as [[maybe_unused]]. __validate_runtime_element_bounds marks both __val and __runtime_bounds as [[maybe_unused]], with the signature reformatted across multiple lines.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@elstehle elstehle force-pushed the fix/cuda-argument-unused-param-warning branch from 3068abb to b571d2b Compare June 3, 2026 06:45
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🥳 CI Workflow Results

🟩 Finished in 2h 45m: Pass: 100%/115 | Total: 18h 51m | Max: 52m 02s | Hits: 97%/345241

See results here.

@davebayer davebayer merged commit 6c08e31 into NVIDIA:main Jun 3, 2026
267 of 270 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants