From: "Michael Brown" <mcb30@ipxe.org>
To: devel@edk2.groups.io, michael.d.kinney@intel.com,
"krichanov@ispras.ru" <krichanov@ispras.ru>
Cc: "gaoliming@byosoft.com.cn" <gaoliming@byosoft.com.cn>,
"Liu, Zhiguang" <zhiguang.liu@intel.com>,
"vit9696@protonmail.com" <vit9696@protonmail.com>
Subject: Re: [edk2-devel] [PATCH] MdePkg: DebugLib: Compilation fix for clang-13.
Date: Mon, 22 Nov 2021 23:17:21 +0000 [thread overview]
Message-ID: <8d9101ac-fbda-eecf-950e-692fa375c3f9@ipxe.org> (raw)
In-Reply-To: <CO1PR11MB49298A07BFBA2125E1D26B86D29F9@CO1PR11MB4929.namprd11.prod.outlook.com>
On 22/11/2021 16:42, Michael D Kinney wrote:
> You are also modifying the DebugLib in the paths where ASSERT() macros
> are disabled. When they are disabled, we want all code/data associated
> with ASSERT() to be removed by the optimizing compiler/linker. The source
> code change appears to force a reference to a variable/expression. Does
> this have any size impact to any of the toolchains when ASSERT() is
> disabled? Can you provide the size comparison before and after this
> change?
I would very strongly recommend having the non-debug version of the
macro use something like:
#define ASSERT(Expression) do { \
if (FALSE) { \
(VOID) (Expression); \
} \
} while (FALSE)
Without the "if (FALSE)", you will find that an expression that may have
side-effects (e.g. by calling an external function) will result in
executable code being generated.
Michael
next prev parent reply other threads:[~2021-11-22 23:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211119090529.2865-1-krichanov@ispras.ru>
2021-11-19 16:51 ` [PATCH] MdePkg: DebugLib: Compilation fix for clang-13 Michael D Kinney
[not found] ` <db6fe4e5b31c28a6bcdb1f189cfcd5b1@ispras.ru>
2021-11-22 16:42 ` Michael D Kinney
2021-11-22 23:17 ` Michael Brown [this message]
2021-11-23 6:41 ` [edk2-devel] " Marvin Häuser
2021-11-23 11:40 ` Michael Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d9101ac-fbda-eecf-950e-692fa375c3f9@ipxe.org \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox