Skip to content

Commit

Permalink
Reactivate warnings.
Browse files Browse the repository at this point in the history
Clean warnings reactivated.
Clean build flags in the 4 configurations to make RELEASE_XCODE8 works
in QEMU.
  • Loading branch information
jief666 committed Feb 10, 2021
1 parent 6809233 commit 5ab1a58
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Library/OcAudioLib/OcAudioWave.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ InternalGetRawData (
//
// Find format and data chunks.
//
while (BufferEnd - BufferPtr >= sizeof (RIFF_CHUNK)) {
while ((UINTN)(BufferEnd - BufferPtr) >= sizeof (RIFF_CHUNK)) {
TmpChunk = (RIFF_CHUNK *) BufferPtr;

//
Expand Down
2 changes: 1 addition & 1 deletion Library/OcMiscLib/DataPatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ FindPattern (

UINTN result = FindMemMask(Data + DataOff, DataSize, Pattern, PatternSize, PatternMask, PatternSize);
if (result != MAX_UINTN) {
if ( result < MAX_INT32 - DataOff ) {
if ( result < (UINT32)(MAX_INT32 - DataOff) ) { // safe cast, MAX_INT32 - DataOff (which is >= 0) is always >= 0
return (INT32)(result + DataOff);
}
}
Expand Down
20 changes: 10 additions & 10 deletions OpenCorePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@

[BuildOptions]
# While there are no PCDs as of now, there at least are some custom macros.
DEFINE OCPKG_BUILD_OPTIONS_GEN = -D DISABLE_NEW_DEPRECATED_INTERFACES $(OCPKG_BUILD_OPTIONS)
DEFINE OCPKG_BUILD_OPTIONS_GEN = -DDISABLE_NEW_DEPRECATED_INTERFACES $(OCPKG_BUILD_OPTIONS)
DEFINE OCPKG_ANAL_OPTIONS_GEN = "-DANALYZER_UNREACHABLE=__builtin_unreachable" "-DANALYZER_NORETURN=__attribute__((noreturn))"

GCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
GCC:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
GCC:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
MSFT:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) /wd4723
MSFT:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) /wd4723
MSFT:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) /wd4723
XCODE:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
XCODE:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
XCODE:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -Oz -flto
GCC:DEBUG_*_*_CC_FLAGS = -DOC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
GCC:NOOPT_*_*_CC_FLAGS = -DOC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
GCC:RELEASE_*_*_CC_FLAGS = -DOC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
MSFT:DEBUG_*_*_CC_FLAGS = -DOC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) /wd4723
MSFT:NOOPT_*_*_CC_FLAGS = -DOC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) /wd4723
MSFT:RELEASE_*_*_CC_FLAGS = -DOC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) /wd4723
XCODE:DEBUG_*_*_CC_FLAGS = -DOC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
XCODE:NOOPT_*_*_CC_FLAGS = -DOC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN)
XCODE:RELEASE_*_*_CC_FLAGS = -DOC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -Oz -flto
10 changes: 8 additions & 2 deletions Platform/OpenCore/OpenCore.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ OcMain (
)
{
EFI_STATUS Status;
#ifndef CLOVER_BUILD
OC_PRIVILEGE_CONTEXT *Privilege;
#endif

DEBUG ((DEBUG_INFO, "OC: OcMiscEarlyInit...\n"));
Status = OcMiscEarlyInit (
Expand Down Expand Up @@ -146,9 +148,13 @@ OcMain (
mOpenCorePrivilege.Salt = OC_BLOB_GET (&mOpenCoreConfiguration.Misc.Security.PasswordSalt);
mOpenCorePrivilege.SaltSize = mOpenCoreConfiguration.Misc.Security.PasswordSalt.Size;

Privilege = &mOpenCorePrivilege;
#ifndef CLOVER_BUILD
Privilege = &mOpenCorePrivilege;
#endif
} else {
Privilege = NULL;
#ifndef CLOVER_BUILD
Privilege = NULL;
#endif
}

DEBUG ((DEBUG_INFO, "OC: All green, starting boot management...\n"));
Expand Down

0 comments on commit 5ab1a58

Please sign in to comment.