Skip to content

Conversation

@ardbiesheuvel
Copy link
Member

@ardbiesheuvel ardbiesheuvel commented Nov 26, 2025

Clang complains about unused variables:

ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:21:60: error: variable 'mRimtNodeHeader' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
21 | STATIC EFI_ACPI_6_6_RIMT_NODE_HEADER_STRUCTURE mRimtNodeHeader;
| ^~~~~~~~~~~~~~~
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:25:60: error: variable 'mRimtIdMappingNode' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
25 | STATIC EFI_ACPI_6_6_RIMT_ID_MAPPING_STRUCTURE mRimtIdMappingNode;
| ^~~~~~~~~~~~~~~~~~
28 | STATIC EFI_ACPI_6_6_RIMT_PCIE_ROOT_COMPLEX_NODE_STRUCTURE mRimtPcieRootComplexNode;
| ^~~~~~~~~~~~~~~~~~~~~~~~
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:29:60: error: variable 'mRimtIommuNode' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
29 | STATIC EFI_ACPI_6_6_RIMT_IOMMU_NODE_STRUCTURE mRimtIommuNode;
| ^~~~~~~~~~~~~~
4 errors generated.

This is because these variables are only used to take the size of their fields using the sizeof() operator. So declare them as 'extern' instead, as no definition is actually needed for this use case.

@ardbiesheuvel
Copy link
Member Author

@pierregondois
Copy link
Contributor

Hi Ard,
I think mRimtInfo should not be changed to extern.
It seems this is what trigger the CI fails

@ardbiesheuvel
Copy link
Member Author

ardbiesheuvel commented Dec 3, 2025

Hi Ard, I think mRimtInfo should not be changed to extern. It seems this is what trigger the CI fails

Indeed - VS2022 doesn't seem to like it. Hmm, I see what you mean now - I don't have access to the failed CI logs anymore, so perhaps I could have fixed this more easily.

Instead, I've replaced the sizeof() with a macro that uses the type directly.

Clang complains about unused variables:

ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:21:60: error: variable 'mRimtNodeHeader' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
   21 | STATIC EFI_ACPI_6_6_RIMT_NODE_HEADER_STRUCTURE             mRimtNodeHeader;
      |                                                            ^~~~~~~~~~~~~~~
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:25:60: error: variable 'mRimtIdMappingNode' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
   25 | STATIC EFI_ACPI_6_6_RIMT_ID_MAPPING_STRUCTURE              mRimtIdMappingNode;
      |                                                            ^~~~~~~~~~~~~~~~~~
   28 | STATIC EFI_ACPI_6_6_RIMT_PCIE_ROOT_COMPLEX_NODE_STRUCTURE  mRimtPcieRootComplexNode;
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:29:60: error: variable 'mRimtIommuNode' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
   29 | STATIC EFI_ACPI_6_6_RIMT_IOMMU_NODE_STRUCTURE              mRimtIommuNode;
      |                                                            ^~~~~~~~~~~~~~
4 errors generated.

This is because these variables are only used to take the size of their
fields using the sizeof() operator, which does not support type names
directly.

So create a helper macro SIZE_OF_T () that provides the functionality we
need, and drop the unused variables.

Signed-off-by: Ard Biesheuvel <[email protected]>
@ardbiesheuvel ardbiesheuvel added the push Auto push patch series in PR if all checks pass label Dec 4, 2025
@mergify
Copy link

mergify bot commented Dec 4, 2025

Merge Queue Status Beta

✅ The pull request has been merged

This pull request spent 18 minutes 20 seconds in the queue, including 18 minutes 11 seconds running CI.
The checks were run in-place.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = tianocore.PatchCheck
    • check-neutral = tianocore.PatchCheck
    • check-skipped = tianocore.PatchCheck
  • any of [🛡 GitHub branch protection]:
    • check-success = ArmVirtPkg - Ubuntu GCC - PR
    • check-neutral = ArmVirtPkg - Ubuntu GCC - PR
    • check-skipped = ArmVirtPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = EmulatorPkg - Ubuntu GCC - PR
    • check-neutral = EmulatorPkg - Ubuntu GCC - PR
    • check-skipped = EmulatorPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = EmulatorPkg - Windows VS - PR
    • check-neutral = EmulatorPkg - Windows VS - PR
    • check-skipped = EmulatorPkg - Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = OvmfPkg - Ubuntu GCC - PR
    • check-neutral = OvmfPkg - Ubuntu GCC - PR
    • check-skipped = OvmfPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = OvmfPkg - Windows VS - PR
    • check-neutral = OvmfPkg - Windows VS - PR
    • check-skipped = OvmfPkg - Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Windows VS - PR
    • check-neutral = Windows VS - PR
    • check-skipped = Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Ubuntu GCC - PR
    • check-neutral = Ubuntu GCC - PR
    • check-skipped = Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate Pull Request Formatting
    • check-neutral = Validate Pull Request Formatting
    • check-skipped = Validate Pull Request Formatting

@mergify mergify bot added the queued label Dec 4, 2025
@mergify mergify bot merged commit 3bc03ff into tianocore:master Dec 4, 2025
107 checks passed
@mergify mergify bot removed the queued label Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

push Auto push patch series in PR if all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants