[edk2-devel] [PATCH] OvmfPkg/QemuKernelLoaderFsDxe: drop tentative const object definition

Laszlo Ersek lersek at redhat.com
Sun Mar 8 09:01:23 UTC 2020


On 03/07/20 15:22, Ard Biesheuvel wrote:
> On Fri, 6 Mar 2020 at 20:22, Laszlo Ersek <lersek at redhat.com> wrote:
>>
>> On 03/06/20 17:40, Ard Biesheuvel wrote:
>>> On Fri, 6 Mar 2020 at 17:14, Laszlo Ersek <lersek at redhat.com> wrote:
>>>>
>>>> On 03/06/20 08:38, Ard Biesheuvel wrote:
>>>>> Bob reports that VS2017 chokes on a tentative definition of the const
>>>>> object 'mEfiFileProtocolTemplate', with the following error:
>>>>>
>>>>>   OvmfPkg\QemuKernelLoaderFsDxe\QemuKernelLoaderFsDxe.c(130):
>>>>>       error C2220: warning treated as error - no 'object' file generated
>>>>>   OvmfPkg\QemuKernelLoaderFsDxe\QemuKernelLoaderFsDxe.c(130):
>>>>>       warning C4132: 'mEfiFileProtocolTemplate': const object should be initialized
>>>>>
>>>>> Let's turn the only function that relies on this tentative definition
>>>>> into a forward declaration itself, and move its definition after the
>>>>> normal definition of the object. That allows us to drop the tentative
>>>>
>>>> (1) s/normal/external/
>>>>
>>>
>>> Are you sure? The const object has static linkage.
>>
>> Yes, I'm sure.
>>
> 
> :-)
> 
> I should have known better than to doubt you on a matter like this ...

That's very kind :) but I do need to be kept on my toes!

> Thanks for the explanation.
> 

Thank you,
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55662): https://edk2.groups.io/g/devel/message/55662
Mute This Topic: https://groups.io/mt/71768124/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list