Skip to content

Commit

Permalink
ArmPkg/ArmMmuLib: Fix implicit cast
Browse files Browse the repository at this point in the history
While building with the following command line:

 build -b DEBUG -a AARCH64 -t VS2017 -p MdeModulePkg\MdeModulePkg.dsc

A missing cast triggers the following warning, then triggering an error:

  ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c(652):
  warning C4152: nonstandard extension, function/data pointer
  conversion in expression

This patch first casts the function pointer to (UINTN), then to (VOID *),
followowing the C99 standard s6.3.2.3 "Pointer", paragraphs 5 and 6.
This suppresses the warning.

Signed-off-by: Pierre Gondois <[email protected]>
Suggested-by: Laszlo Ersek <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
  • Loading branch information
pierregondois authored and mergify[bot] committed Jun 27, 2020
1 parent a4a2258 commit 654dc3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ ArmMmuBaseLibConstructor (
// The ArmReplaceLiveTranslationEntry () helper function may be invoked
// with the MMU off so we have to ensure that it gets cleaned to the PoC
//
WriteBackDataCacheRange (ArmReplaceLiveTranslationEntry,
WriteBackDataCacheRange ((VOID *)(UINTN)ArmReplaceLiveTranslationEntry,
ArmReplaceLiveTranslationEntrySize);

return RETURN_SUCCESS;
Expand Down

0 comments on commit 654dc3e

Please sign in to comment.