[systemd-devel] [PATCH] boot: efi - move background pixel variable into different scope

David Herrmann dh.herrmann at gmail.com
Wed Mar 11 09:20:07 PDT 2015


Hi

On Fri, Feb 27, 2015 at 8:11 PM, Kay Sievers <kay at vrfy.org> wrote:
> On Fri, Feb 27, 2015 at 6:12 PM, Marcel Holtmann <marcel at holtmann.org> wrote:
>>>>  CC       src/boot/efi/splash.o
>>>> src/boot/efi/splash.c: In function ‘graphics_splash’:
>>>> src/boot/efi/splash.c:256:9: warning: missing initializer for field ‘Blue’ of ‘EFI_GRAPHICS_OUTPUT_BLT_PIXEL’ [-Wmissing-field-initializers]
>>>>         EFI_GRAPHICS_OUTPUT_BLT_PIXEL pixel = { };
>>>>         ^
>>>> In file included from /usr/include/efi/efi.h:39:0,
>>>>                 from src/boot/efi/splash.c:18:
>>>> /usr/include/efi/efiprot.h:641:9: note: ‘Blue’ declared here
>>>>   UINT8 Blue;
>>>>         ^
>>>
>>> That patch removes the initializer?
>>
>> indeed, if you do not have background provided, then it is undefined. And also in the Apple case, the Reserved field would not be set. Anyway, I have no idea on how to fix this compiler warning the right way.
>>
>> Alternatively doing something like this shuts it up as well:
>>
>>  EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background) {
>> -        EFI_GRAPHICS_OUTPUT_BLT_PIXEL pixel = {};
>> +        EFI_GRAPHICS_OUTPUT_BLT_PIXEL pixel = { 0x00, };
>
> I guess we should just add -Wno-missing-field-initializers, like we do
> for the systemd code?

For completeness, this was done in:

commit 6a333238366b3f28124f724ad607a0f00f41a328
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Fri Feb 27 17:26:48 2015 -0500

    build-sys: use -Wno-missing-field-initializers for efi stuff

Thanks
David


More information about the systemd-devel mailing list