Repository navigation
docs(amdsmi): fix /* within comment warning in AMPP profile doxygen - #13848
Merged
Merged
Conversation
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>
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
Contributor
There was a problem hiding this comment.
🟡 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
/* within comment warning in AMPP profile doxygen/* within comment warning in AMPP profile doxygen
marifamd
approved these changes
Oct 20, 2026
gabrpham
approved these changes
Oct 21, 2026
Contributor
TheRock Submodule Bump ActivityNewest first
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
The doxygen for the AMPP set-profile-fields API contains
config/*, which opens a nested comment.Every translation unit that includes
amdsmi.hemits-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):AMDSMI_STATUS_NO_PERMdescription to "the files underapp_modes/<profile_name>/config/". Comment-only, no ABI or behavior change.Tests (
tests/python/unit/system/test_amdsmi_header_comments.py):find_nested_comment_openers(), which reports each/*inside a block comment and skips//comments and string literals.amdsmi.hfrom the source tree or the installedinclude/amd_smi/, sounit_tests.pycovers 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)amdsmi.h: it fails and reports line 10745<rocm>/share/amd_smi/tests/python_unittest) with and without the header presentruff check,ruff format --check, and thepre-commithooks on both commitsTest Result
<rocm>/include/amd_smi/amdsmi.h, skips cleanly when absentunit_tests.pyrun has 78 failures in my environment, identical with and without the new file. Not caused by this PRSubmission Checklist