clang: Exclude efi_main from -Wmissing-prototypes

When compiling UEFI applications, the main function is named
efi_main() instead of main(). Let's exclude efi_main() from
-Wmissing-prototypes as well to avoid warnings when working
on UEFI applications.

Differential Revision: https://reviews.llvm.org/D95746
This commit is contained in:
Daan De Meyer 2021-01-30 19:28:11 +00:00
parent 5ec75c6007
commit 7dd42ecfa2
2 changed files with 5 additions and 1 deletions

View File

@ -13873,7 +13873,7 @@ ShouldWarnAboutMissingPrototype(const FunctionDecl *FD,
// Don't warn about 'main'. // Don't warn about 'main'.
if (isa<TranslationUnitDecl>(FD->getDeclContext()->getRedeclContext())) if (isa<TranslationUnitDecl>(FD->getDeclContext()->getRedeclContext()))
if (IdentifierInfo *II = FD->getIdentifier()) if (IdentifierInfo *II = FD->getIdentifier())
if (II->isStr("main")) if (II->isStr("main") || II->isStr("efi_main"))
return false; return false;
// Don't warn about inline functions. // Don't warn about inline functions.

View File

@ -4,3 +4,7 @@
int main() { int main() {
return 0; return 0;
} }
int efi_main() {
return 0;
}