That was my initial suggestion.
I am guessing Michael's change should now be in the Intel internal review 
process to be integrated soon.

-----Original Message-----
From: Laszlo Ersek [mailto:ler...@redhat.com]
Sent: 07 April 2015 14:11
To: Olivier Martin; Kinney, Michael D
Cc: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [PATCH] MdePkg/DevicePath.h: Fixed 'integer operation 
result is out of range'

On 04/01/15 16:46, Kinney, Michael D wrote:
> Oliver,
>
> What is the test case that fails?  It is passing in a constant or a
> variable as the first parameter to the macro.  If it is a variable, I
> am guessing that the type is smaller than UINT32?
>
> It makes sense that the left shift 31 bits needs to be considered as a
> UINT32 for that to be meaningful.
>
> I am curious.  Does the following change top use a typecast to UINT32
> before the shift also resolve the compiler compatibility issue?
>
> #defineACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput,
> _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
>
>           ((UINT32)(  ((UINT32)((_DeviceIdScheme) & 0x1) << 31) |  \
>                       (((_HeadId)         & 0x7) << 18) |  \
>                       (((_NonVgaOutput)   & 0x1) << 17) |  \
>                       (((_BiosCanDetect)  & 0x1) << 16) |  \
>                       (((_VendorInfo)     & 0xf) << 12) |  \
>                       (((_Type)           & 0xf) << 8)  |  \
>                       (((_Port)           & 0xf) << 4)  |  \
>                        ((_Index)          & 0xf) ))

Side point (since this thread seems to be finished): the simplest would be to 
use the constant

  0x1u

in the subexpression in question. That would force _DeviceIdScheme to be 
converted to unsigned int (from int), according to the Usual Arithmetic 
Conversions. Then the result of the bitwise and, ie. the LHS operand of the 
bitwise shift, would also be UINT32.

Thanks
Laszlo


-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered 
in England & Wales, Company No:  2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
Registered in England & Wales, Company No:  2548782


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to