Interesting… My guess would be that is used to do something and is the side 
effect of a find and replace operation and it should have been removed, but 
wasn’t…

-Jaben



From: peter.kirme...@ts.fujitsu.com [mailto:peter.kirme...@ts.fujitsu.com]
Sent: Wednesday, June 29, 2016 1:22 AM
To: Michael Zimmermann <sigmaepsilo...@gmail.com>
Cc: edk2-devel@lists.01.org; Carsey, Jaben <jaben.car...@intel.com>; Qiu, 
Shumin <shumin....@intel.com>
Subject: RE: [edk2] weird ShellPkg line
Importance: High

Hi,

yes that’s right. I found those TRUE-Asserts on various other projects as well 
and I never saw any good reason for this.
My most popular assumptions are that this is some kind of “prepare an assert 
here, so it can be enabled easily”.
Or “let the debug message be part of the binary, so I can find this line of 
code more easily in the debugger without symbols”.

Maybe someone here has any good reason for such constructs. I lived with my 
assumptions about that.

Best Regards,
  Peter

From: Michael Zimmermann [mailto:sigmaepsilo...@gmail.com]
Sent: Wednesday, June 29, 2016 10:12 AM
To: Kirmeier, Peter
Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>; Jaben Carsey; 
Shumin Qiu
Subject: Re: [edk2] weird ShellPkg line

Hi,

but doesn't ASSERT only trigger if the condition is not true?
to me it looks like this ASSERT would never show an error.

Thanks,
Michael

On Wed, Jun 29, 2016 at 9:53 AM, 
peter.kirme...@ts.fujitsu.com<mailto:peter.kirme...@ts.fujitsu.com> 
<peter.kirme...@ts.fujitsu.com<mailto:peter.kirme...@ts.fujitsu.com>> wrote:
Hi Michael,

for me it looks like an ASSERT(TRUE) when no GUID comparison matched.
It actually produces a more readable debug message rather than "TRUE" which 
allows you to find the actual ASSERT faster.

Best Regards,
  Peter

-----Original Message-----
From: edk2-devel 
[mailto:edk2-devel-boun...@lists.01.org<mailto:edk2-devel-boun...@lists.01.org>]
 On Behalf Of Michael Zimmermann
Sent: Wednesday, June 29, 2016 9:42 AM
To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Jaben Carsey; Shumin Qiu
Subject: [edk2] weird ShellPkg line

Hi,

I found this weird line in ShellPkg(which also throws a warning in GCC6).
What does it do?

ASSERT((*HandleType)[HandleIndex] == (*HandleType)[HandleIndex]);

https://github.com/tianocore/edk2/blob/master/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c#L2465


Thanks
Michael
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to