Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-03-01 Thread Marvin Häuser
gt; de...@lists.01.org; Kinney, Michael D > Cc: ler...@redhat.com; Gao, Liming > Subject: RE: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise > operations. > > Marvin, > > Thanks. I agree that there may be some compiler behavior assumptions. > > I would pref

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-03-01 Thread Kinney, Michael D
äuser > Sent: Thursday, March 1, 2018 3:11 AM > To: edk2-devel@lists.01.org; Kinney, Michael D > > Cc: ler...@redhat.com; Gao, Liming > > Subject: Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure > safe bitwise operations. > > > > -Original Message- > >

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-03-01 Thread Marvin Häuser
> -Original Message- > From: Laszlo Ersek > Sent: Thursday, March 1, 2018 11:40 AM > To: Marvin Häuser ; edk2- > de...@lists.01.org > Cc: michael.d.kin...@intel.com; liming@intel.com > Subject: Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise > oper

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-03-01 Thread Marvin Häuser
> -Original Message- > From: Kinney, Michael D > Sent: Thursday, March 1, 2018 2:42 AM > To: Marvin Häuser ; edk2- > de...@lists.01.org; Kinney, Michael D > Cc: ler...@redhat.com; Gao, Liming > Subject: RE: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-03-01 Thread Laszlo Ersek
ts.01.org; Laszlo Ersek >> Cc: michael.d.kin...@intel.com; liming@intel.com >> Subject: Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise >> operations. >> >> I have just locally updated all BIT defines to use the ULL prefix and added >> casts to

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Kinney, Michael D
edk2-devel@lists.01.org; Kinney, Michael D > > Cc: ler...@redhat.com; Gao, Liming > > Subject: RE: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure > safe bitwise operations. > > Hey Mike, > > You are right, the patch was premature because I did > not consider any 'incorre

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Marvin Häuser
gt; > > Best regards, > > Marvin. > > > > > -----Original Message- > > > From: Laszlo Ersek > > > Sent: Wednesday, February 28, 2018 2:57 PM > > > To: Marvin Häuser ; edk2- > > > de...@lists.01.org > > > Cc: michael.d.kin.

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Marvin Häuser
ginal Message- > From: Kinney, Michael D > Sent: Wednesday, February 28, 2018 7:37 PM > To: Marvin Häuser ; edk2- > de...@lists.01.org; Laszlo Ersek ; Kinney, Michael D > > Cc: Gao, Liming > Subject: RE: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise > opera

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Marvin Häuser
kin...@intel.com; liming@intel.com > Subject: Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise > operations. > > Hey Laszlo, > > I cut your rant because it is not strictly related to this patch. However, > thank > you for composing it nevertheless because i

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Kinney, Michael D
ook.com] > Sent: Wednesday, February 28, 2018 6:21 AM > To: edk2-devel@lists.01.org; Laszlo Ersek > > Cc: Kinney, Michael D ; > Gao, Liming > Subject: RE: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure > safe bitwise operations. > > Hey Laszlo, > > I cut your rant becau

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Marvin Häuser
. > -Original Message- > From: Laszlo Ersek > Sent: Wednesday, February 28, 2018 2:57 PM > To: Marvin Häuser ; edk2- > de...@lists.01.org > Cc: michael.d.kin...@intel.com; liming@intel.com > Subject: Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise > oper

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Laszlo Ersek
On 02/28/18 14:57, Laszlo Ersek wrote: > On 02/28/18 12:43, Marvin Häuser wrote: >> +2) Binary operations (AND, OR, ...) should not raise any problems at >> all (except for our fellow using VS2005x86 :) ) > > Haha :) In earnest though, you are right. Hm... It should not be a frequent pattern, bu

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Laszlo Ersek
On 02/28/18 12:43, Marvin Häuser wrote: > Actually, your explanations and the rest of the bit defines made me > wonder, whether marking all BIT defines and bit masks of any kind, > anywhere, as ULL, might be the best solution. For a new project just being started, that could be one of the safest

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Marvin Häuser
e...@lists.01.org > >> Cc: michael.d.kin...@intel.com; liming....@intel.com > >> Subject: Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise > >> operations. > >> [...] > > This is exactly how I feel, yes. My concern is that making the cha

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-28 Thread Laszlo Ersek
On 02/27/18 21:31, Marvin Häuser wrote: >> -Original Message- >> From: Laszlo Ersek >> Sent: Tuesday, February 27, 2018 8:54 PM >> To: Marvin Häuser ; edk2- >> de...@lists.01.org >> Cc: michael.d.kin...@intel.com; liming....@intel.com >> Sub

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-27 Thread Marvin Häuser
ming@intel.com > Subject: Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise > operations. > > On 02/27/18 17:47, Marvin Häuser wrote: > > As per the C standard, bit-level operations on signed integers are > > either undefined or implementation-defined. Hence, mark

Re: [edk2] [PATCH 1/2] MdePkg/Base.h: Ensure safe bitwise operations.

2018-02-27 Thread Laszlo Ersek
On 02/27/18 17:47, Marvin Häuser wrote: > As per the C standard, bit-level operations on signed integers are > either undefined or implementation-defined. Hence, mark all BIT > defines and shifts as unsigned to safely allow such operations. Sigh, this is why threading is important in patch sets. :