Skip to content

TestCase: Add missing EFIAPI specifier in test entry points to fix FTBFS w/ GCC 14 #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Cyanoxygen
Copy link

The SctPkg does not build with GCC 14, with the following error:

/buildroot/cyan/edk2-test/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.c:54:5: error: initialization of ‘EFI_STATUS (__attribute__((ms_abi)) *)(EFI_BB_TEST_PROTOCOL *, void *, EFI_TEST_LEVEL,  void *)’ {aka ‘long long unsigned int (__attribute__((ms_abi)) *)(struct _EFI_BB_TEST_PROTOCOL *, void *, unsigned int,  void *)’} from incompatible pointer type ‘EFI_STATUS (*)(EFI_BB_TEST_PROTOCOL *, void *, EFI_TEST_LEVEL,  void *)’ {aka ‘long long unsigned int (*)(struct _EFI_BB_TEST_PROTOCOL *, void *, unsigned int,  void *)’} [-Wincompatible-pointer-types]
   54 |     BBTestTCGMemoryOverwriteRequestFunctionTest
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/buildroot/cyan/edk2-test/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.c:54:5: note: (near initialization for ‘gLoadTCGMemoryOverwriteRequestEntryField[0].EntryPoint’)
make: *** [GNUmakefile:331: /buildroot/cyan/edk2-test/uefi-sct/Build/UefiSct/RELEASE_GCC5/X64/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTest/OUTPUT/TCGMemoryOverwriteRequestBBTestMain.obj] Error 1

This is due to GCC 14 treating incompatible pointer type occurrences as errors by default. EFI_BB_TEST_ENTRY_FIELD uses EFI_BB_ENTRY_POINT, which uses EFIAPI in the declaration. The entry points defined are not using EFIAPI, which in turn causes incompatible pointer types.

Adding EFIAPI to these defined entry point signatures fixes the problem.

Missing EFIAPI in the actual signature of the entry points now causes
the build to fail, reporting incompatible types, as the EntryPoint
field requires the EFIAPI in the function declaration. Adding EFIAPI
to their function signatures fixes this problem.
@tianocore-assign-reviewers
Copy link

WARNING: Cannot add some reviewers: A user specified as a reviewer for this PR is not a collaborator of the repository. Please add them as a collaborator to the repository so they can be requested in the future.

Non-collaborators requested:

Attn Admins:


Admin Instructions:

  • Add the non-collaborators as collaborators to the appropriate team(s) listed in teams
  • If they are no longer needed as reviewers, remove them from Maintainers.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants