Skip to content

docs(amdsmi): fix /* within comment warning in AMPP profile doxygen - #13848

Merged
oliveiradan merged 2 commits into
developfrom
users/daolivei/ampp_profile_doc_warnings
Oct 21, 2026
Merged

oliveiradan merged 2 commits into
developfrom
users/daolivei/ampp_profile_doc_warnings

Conversation

@oliveiradan

Copy link
Copy Markdown
Contributor

Motivation

The doxygen for the AMPP set-profile-fields API contains config/*, which opens a nested comment.
Every translation unit that includes amdsmi.h emits -Wcomment: 117 warnings in one full build log. A guard test keeps it from coming back.

Technical Details

Header / docs (include/amd_smi/amdsmi.h):

  • Reworded the AMDSMI_STATUS_NO_PERM description to "the files under app_modes/<profile_name>/config/". Comment-only, no ABI or behavior change.

Tests (tests/python/unit/system/test_amdsmi_header_comments.py):

  • Add find_nested_comment_openers(), which reports each /* inside a block comment and skips // comments and string literals.
  • Scan amdsmi.h from the source tree or the installed include/amd_smi/, so unit_tests.py covers both layouts. The test skips if neither has the header.

Issue Tracking

JIRA ID: AILITOOLS-362

Test Plan

  • unit_tests.py -k NestedComment -v (5 tests: 4 on synthetic text, 1 on the real header)
  • Ran the header test against the pre-fix amdsmi.h: it fails and reports line 10745
  • Ran the test from a simulated installed layout (<rocm>/share/amd_smi/tests/python_unittest) with and without the header present
  • ruff check, ruff format --check, and the pre-commit hooks on both commits

Test Result

  • 5 of 5 pass on the fixed header. The real-header test fails on the pre-fix header, as intended
  • Installed layout: finds <rocm>/include/amd_smi/amdsmi.h, skips cleanly when absent
  • The full unit_tests.py run has 78 failures in my environment, identical with and without the new file. Not caused by this PR

Submission Checklist

The set-profile-fields doxygen contained ``config/*``, which opens a nested comment and triggers ``-Wcomment`` in every translation unit that includes ``amdsmi.h``.

Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
- Add ``find_nested_comment_openers()`` to flag a ``/*`` inside a block
  comment, skipping ``//`` comments and string literals
- Scan ``amdsmi.h`` from the source tree or the installed
  ``include/amd_smi/`` so ``unit_tests.py`` covers both layouts in CI

Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
@oliveiradan
oliveiradan requested review from a team and a balanced review from Copilot October 20, 2026 19:42
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new scanner reports incorrect source lines after escaped newlines in string literals.

1 open issue
What changed in this PR

Removes a nested-comment warning from the AMDSMI public header and adds a regression guard.

Changes:

  • Rewords AMPP documentation without changing API behavior.
  • Adds scanner tests and header discovery for source and installed layouts.
File Description
projects/​amdsmi/​tests/​python/​unit/​system/​test_amdsmi_header_comments.py Adds nested-comment detection and regression tests.
projects/​amdsmi/​include/​amd_smi/​amdsmi.h Removes the comment opener from permission documentation.

Review effort: Balanced

@oliveiradan oliveiradan changed the title Title: docs(amdsmi): fix /* within comment warning in AMPP profile doxygen docs(amdsmi): fix /* within comment warning in AMPP profile doxygen Oct 20, 2026
@oliveiradan
oliveiradan merged commit afbc22d into develop Oct 21, 2026
159 of 174 checks passed
@oliveiradan
oliveiradan deleted the users/daolivei/ampp_profile_doc_warnings branch October 21, 2026 15:31
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants