Re: [edk2] [PATCH] MdePkg/BaseLib: do not rely on undefined behavior in arithmetic shift

2016-05-22 Thread Gao, Liming
{ > > } > > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Gao, Liming > Sent: Thursday, December 17, 2015 4:29 AM > To: Ard Biesheuvel; edk2-devel@lists.01.org > Cc: dw...@infradead.org > Subject: Re: [edk2

Re: [edk2] [PATCH] MdePkg/BaseLib: do not rely on undefined behavior in arithmetic shift

2016-05-20 Thread Felix Poludov
Sent: Thursday, December 17, 2015 4:29 AM To: Ard Biesheuvel; edk2-devel@lists.01.org Cc: dw...@infradead.org Subject: Re: [edk2] [PATCH] MdePkg/BaseLib: do not rely on undefined behavior in arithmetic shift Ard: Have you found other similar cases in EDKII project? Or, it this the only one?

Re: [edk2] [PATCH] MdePkg/BaseLib: do not rely on undefined behavior in arithmetic shift

2015-12-17 Thread Ard Biesheuvel
On 17 December 2015 at 10:29, Gao, Liming wrote: > Ard: > Have you found other similar cases in EDKII project? Or, it this the only > one? > I found this one as well: .../PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c:488:32: error: shifting a negative signed value is undefined [-Werror,-

Re: [edk2] [PATCH] MdePkg/BaseLib: do not rely on undefined behavior in arithmetic shift

2015-12-17 Thread Gao, Liming
Ard: Have you found other similar cases in EDKII project? Or, it this the only one? Thanks Liming -Original Message- From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] Sent: Wednesday, December 16, 2015 6:49 PM To: edk2-devel@lists.01.org; Gao, Liming Cc: dw...@infradead.org; Ard B

[edk2] [PATCH] MdePkg/BaseLib: do not rely on undefined behavior in arithmetic shift

2015-12-16 Thread Ard Biesheuvel
The runtime test whether the compiler supports arithmetic shift of negative signed numbers currently relies on undefined behavior in C, which means that all bets are off regarding whether the condition that follows passes or fails, regardless of whether the compiler in fact supports arithmetic shif