当前位置: 代码迷 >> 综合 >> error: passing argument 3 of ‘gBS->CreateEvent’ from incompatible pointer type [-Werror=incompatible
  详细解决方案

error: passing argument 3 of ‘gBS->CreateEvent’ from incompatible pointer type [-Werror=incompatible

热度:70   发布时间:2023-12-05 22:52:26.0

/home/x/UEFI/edk22/MdeModulePkg/Application/UiApp/FrontPage.c:590:3: error: passing argument 3 of ‘gBS->CreateEvent’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  590 |   &TimeoutSelf,
      |   ^~~~~~~~~~~~
      |   |
      |   void (*)(void *, void *)
/home/x/UEFI/edk22/MdeModulePkg/Application/UiApp/FrontPage.c:590:3: note: expected ‘EFI_EVENT_NOTIFY’ {aka ‘void (__attribute__((ms_abi)) *)(void *, void *)’} but argument is of type ‘void (*)(void *, void *)’

gBS->CreateEvent创建事件,在定义回调函数的时候需要添加EFIAPI,在-a IA32可以编译通过,但是在-a X64编译不通过。添加完EFIAPI后可编译通过。
VOID EFIAPI TimeoutSelf(
    IN EFI_EVENT Event,
    IN VOID           *Context
    )

  相关解决方案