Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: ae83c6b7fd83a5906e016a32027c1bcd792a624e
      
https://github.com/tianocore/edk2/commit/ae83c6b7fd83a5906e016a32027c1bcd792a624e
  Author: Mike Beaton <mjsbea...@gmail.com>
  Date:   2024-10-18 (Fri, 18 Oct 2024)

  Changed paths:
    M 
ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c
    M MdePkg/Include/Library/DebugLib.h

  Log Message:
  -----------
  MdePkg: Fix null macros for XCODE5 and CLANG

When building OvmfPkg in RELEASE mode in the XCODE5 toolchain, the
ASSERT_EFI_ERROR change prevents this error:

.../MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:141:15:
error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable]
  EFI_STATUS  Status;
              ^

which is currently stopping the build.

When building in RELEASE mode in the CLANGPDB toolchain,the DEBUG macro
change prevents this error:

.../edk2/OvmfPkg/VirtioSerialDxe/VirtioSerial.c:28:22: error:
variable &apos;EventNames&apos; is not needed and will not be
emitted [-Werror,-Wunneeded-internal-declaration]
STATIC CONST CHAR8  *EventNames[] = {
                     ^

which is currently stopping the build.

CLANGDWARF produces the same error as CLANGPDB above, if
-Wno-unneeded-internal-declaration is removed from its build flags.
With the null DEBUG macro change, this warning suppression
can be removed from CLANGDWARF, which is considered a benefit
as it has the potential to catch real coding errors. This is
done in a subsequent commit.

This commit has the desirable side effect that we no longer require
(and cannot use) explicit `#ifndef MDEPKG_NDEBUG` around items only
used in DEBUG macros. This requires the ArmPkg change made here to
be in the same commit as the MdePkg changes.

Note: In common with existing macros in EDK II, including the pre-existing
and unchanged DEBUG/NOOPT versions of the macros which are modified here,
we use the standard approach of adding `do { ... } while (FALSE)` wrapping
to ensure that the macros behave correctly with surrounding code
(e.g. require a following ';' and do not combine in unexpected ways with
nearby conditionals).

Continuous-integration-options: PatchCheck.ignore-multi-package
Co-authored-by: Mikhail Krichanov <kricha...@ispras.ru>
Signed-off-by: Mike Beaton <mjsbea...@gmail.com>


  Commit: 8f84eb0e761992dc1218f63ee53a54ac0c65630f
      
https://github.com/tianocore/edk2/commit/8f84eb0e761992dc1218f63ee53a54ac0c65630f
  Author: Mike Beaton <mjsbea...@gmail.com>
  Date:   2024-10-18 (Fri, 18 Oct 2024)

  Changed paths:
    M BaseTools/Conf/tools_def.template

  Log Message:
  -----------
  BaseTools: Remove -Wno-unneeded-internal-declaration from CLANGDWARF

Subsequent to updating the 'null' DEBUG macro to explicitly
discard its expression, it is possible to remove this warning
suppression from CLANGDWARF and still successfully compile
its RELEASE build.

Note that CLANGPDB did and does not have this warning suppressed,
and so before updating the 'null' DEBUG macro, CLANGPDB RELEASE
was not building successfully in recent versions of clang,
but was stopping with the error:

.../edk2/OvmfPkg/VirtioSerialDxe/VirtioSerial.c:28:22: error:
variable &apos;EventNames&apos; is not needed and will not be
emitted [-Werror,-Wunneeded-internal-declaration]
STATIC CONST CHAR8  *EventNames[] = {
                     ^

This change makes the two CLANG variants match with respect
to this warning, and leaves the warning enabled which is
considered a benefit as it has the potential to catch real
coding errors

Signed-off-by: Mike Beaton <mjsbea...@gmail.com>


Compare: https://github.com/tianocore/edk2/compare/6e197a8ba5e3...8f84eb0e7619

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to