Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang

2023-12-12 Thread Laszlo Ersek
On 12/12/23 16:33, Mike Beaton wrote: > > I believe one way to approach it would be to (a) amend the patch with > >    --author="Marvin Häuser >" > > and (b) have S-o-b's from both Marvin and you at the end of the commit > message. > > > As I

Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang

2023-12-12 Thread Mike Beaton
> I believe one way to approach it would be to (a) amend the patch with > >--author="Marvin Häuser " > > and (b) have S-o-b's from both Marvin and you at the end of the commit > message. > As I say, I think the code in question is actual by Mikhail, despite appearances, but I should be able

Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang

2023-12-12 Thread Laszlo Ersek
On 12/12/23 13:57, Mike Beaton wrote: >> You failed to mention where you found this patch. > > It's from https://github.com/acidanthera/audk/commit/dcd0a768b0f > (which actually contains the code described in its commit message, but > I believe some other code, including this specific part, which

Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang

2023-12-12 Thread Laszlo Ersek
On 12/12/23 11:33, Mike Beaton wrote: >> This seems redundant to me. Either we set the pragma and the compiler >> does not care, or we don't, and rely on the fact that the compiler can >> infer that 'Expression' will never be evaluated at runtime, but won't >> complain about symbols that are only

Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang

2023-12-12 Thread Mike Beaton
> You failed to mention where you found this patch. It's from https://github.com/acidanthera/audk/commit/dcd0a768b0f (which actually contains the code described in its commit message, but I believe some other code, including this specific part, which got squashed in at some point, and I believe

Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang

2023-12-12 Thread Mike Beaton
> This seems redundant to me. Either we set the pragma and the compiler > does not care, or we don't, and rely on the fact that the compiler can > infer that 'Expression' will never be evaluated at runtime, but won't > complain about symbols that are only referenced via 'Expression' and > nowhere

Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang

2023-12-12 Thread Ard Biesheuvel
On Tue, 12 Dec 2023 at 09:49, Mike Beaton wrote: > > From: Mike Beaton > > Provides a variant of the DEBUG macro for clang when MDEPKG_NDEBUG is defined, > which uses but discards the contained expression, this means clang can tell > that it has optimised away variable usage, therefore we can

[edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang

2023-12-12 Thread Mike Beaton
From: Mike Beaton Provides a variant of the DEBUG macro for clang when MDEPKG_NDEBUG is defined, which uses but discards the contained expression, this means clang can tell that it has optimised away variable usage, therefore we can keep -Wunneeded-internal-declaration (as part of -Wall) to warn