Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: EFI changes break NET4501 kernel build



On Wed, 15 Feb 2017, John D. Baker wrote:

> #   compile  NET4501/efi.o
> /x/current/src/sys/arch/x86/x86/efi.c: In function 'efi_get_e820memmap':
> /x/current/src/sys/arch/x86/x86/efi.c:421:26: error: 'end_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    entry->size = end_addr - start_addr;
>                           ^
> /x/current/src/sys/arch/x86/x86/efi.c:420:15: error: 'start_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    entry->addr = start_addr;
>                ^
> cc1: all warnings being treated as errors

While I can follow the logic in "efi_get_e820memmap()", GCC with "-Os"
(NET4501 makeoptions) cannot, so it complains as shown.

Their values are unset until the first time through the loop, so might
as well initialize them with a suitable dummy value, like zero (what's
the appropriate suffix for uint64_t constant?  ULL?).

-- 
|/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645



Home | Main Index | Thread Index | Old Index