Re: [edk2-devel] [PATCH V3] DebugLib: Update DEBUG macro used when MDEPKG_NDEBUG is defined

2023-12-13 Thread Ard Biesheuvel
(cc MdePkg and BaseTools maintainers) On Thu, 14 Dec 2023 at 00:08, Mike Beaton wrote: > > From: Mike Beaton > > The variant provided when MDEPKG_NDEBUG is defined will be optimised > away in RELEASE builds, but by referencing the argument list, avoids > unused variable errors from valid debug

Re: [edk2-devel] [PATCH V3] DebugLib: Update DEBUG macro used when MDEPKG_NDEBUG is defined

2023-12-13 Thread Mike Beaton
Got it. These are the fixes for ArmVirtQemu.dsc. If people have already manually worked round this issue it interferes with this global fix (we had this in one file in Acidanthera code). There don't seem to be many instances of that in the entire EDK-II codebase, however, fortunately. diff --git

Re: [edk2-devel] [PATCH V3] DebugLib: Update DEBUG macro used when MDEPKG_NDEBUG is defined

2023-12-13 Thread Mike Beaton
I have currently gone with `if (FALSE)` in the above, even though Michael Brown kindly offered tests which showed that `if ((FALSE))` might help in a closely related context - i.e. when discussing Mikhail's variant of this and related code - two years ago now:

[edk2-devel] [PATCH V3] DebugLib: Update DEBUG macro used when MDEPKG_NDEBUG is defined

2023-12-13 Thread Mike Beaton
From: Mike Beaton The variant provided when MDEPKG_NDEBUG is defined will be optimised away in RELEASE builds, but by referencing the argument list, avoids unused variable errors from valid debug code, for example when STATIC variables are used only in DEBUG statements. Signed-off-by: Mike