Repository navigation
fix(amdsmi) Fix backwards includes in rocm_smi.h - #10853
Conversation
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
dmitrii-galantsev
left a comment
There was a problem hiding this comment.
claude:
Correct diagnosis of a real bug — the #ifdef __cplusplus include branches were genuinely backwards and broke C consumers. Approving with b8a5620 layered on top, which restores the extern "C" { that had been dropped while its closing brace remained; the header now compiles clean as both C11 and C++17 with all rsmi_* symbols verified at C linkage.
|
Thank you @dmitrii-galantsev I rushed this PR since I knew it was an issue but was headed away for the weekend. Thanks for validating and fixing the PR. I couldn't figure out where the matching } was for extern C {. It seemed that it might have made sense to remove it. Your changes make sense. Glad to see you glance at this half baked PR since it was actually needed. |
|
yeah no prob! Whatever makes the code better! I'll take a half baked PR over an issue any day :) we're fighting some gremlins right now, so CI might look broken. it's only partially true |
|
my bad meant to rebase. maybe i wont touch more PRs on friday. |
The includes for cplusplus and C were backwards, and extern C is redundant in this case, I believe.
The include-block swap is correct, but the opening extern "C" { was
removed while its closing brace remained at the end of the header, so
every C++ translation unit including this public header hit a stray '}'.
It cannot simply go back where it was: the C++ branch now includes
<cstddef>/<cstdint>, which must not be pulled in under C language
linkage. Reopening the block after the includes keeps all rsmi_*
declarations at C linkage and avoids an ABI break from name mangling.
TheRock Submodule Bump ActivityNewest first
|
The includes for cplusplus and C were backwards, and extern C is redundant in this case, I believe.
Motivation
Fixes compilation errors or warnings for rocm_smi
Technical Details
Issue Tracking
Test Plan
Test Result
Submission Checklist