Project

General

Profile

Bug #11539

dboot: build errors with gcc9

Added by Toomas Soome 10 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:

Description

Errors while building with gcc 9:

    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_loader_mmap_entries':
    ../../i86pc/dboot/dboot_startkern.c:691:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      691 |    for (mmap = (mb_memory_map_t *)mb_info->mmap_addr;
          |                ^
    ../../i86pc/dboot/dboot_startkern.c:692:8: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      692 |        (uint32_t)mmap < mb_info->mmap_addr +
          |        ^
    ../../i86pc/dboot/dboot_startkern.c:694:35: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      694 |        mmap = (mb_memory_map_t *)((uint32_t)mmap +
          |                                   ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_loader_mmap_get_type':
    ../../i86pc/dboot/dboot_startkern.c:728:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      728 |   mp = (mb_memory_map_t *)mb_info->mmap_addr;
          |        ^
    ../../i86pc/dboot/dboot_startkern.c:729:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      729 |   mpend = (mb_memory_map_t *)
          |           ^
    ../../i86pc/dboot/dboot_startkern.c:733:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      733 |    mp = (mb_memory_map_t *)((uint32_t)mp + mp->size +
          |                             ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_loader_mmap_get_base':
    ../../i86pc/dboot/dboot_startkern.c:765:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      765 |   mp = (mb_memory_map_t *)mb_info->mmap_addr;
          |        ^
    ../../i86pc/dboot/dboot_startkern.c:766:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      766 |   mpend = (mb_memory_map_t *)
          |           ^
    ../../i86pc/dboot/dboot_startkern.c:770:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      770 |    mp = (mb_memory_map_t *)((uint32_t)mp + mp->size +
          |                             ^
    ../../i86pc/dboot/dboot_startkern.c:766:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      766 |   mp = (mb_memory_map_t *)mb_info->mmap_addr;
          |        ^
    ../../i86pc/dboot/dboot_startkern.c:767:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      767 |   mpend = (mb_memory_map_t *)
          |           ^
    ../../i86pc/dboot/dboot_startkern.c:771:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      771 |    mp = (mb_memory_map_t *)((uint32_t)mp + mp->size +
          |                             ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_loader_mmap_get_length':
    ../../i86pc/dboot/dboot_startkern.c:805:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      805 |   mp = (mb_memory_map_t *)mb_info->mmap_addr;
          |        ^
    ../../i86pc/dboot/dboot_startkern.c:806:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      806 |   mpend = (mb_memory_map_t *)
          |           ^
    ../../i86pc/dboot/dboot_startkern.c:810:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      810 |    mp = (mb_memory_map_t *)((uint32_t)mp + mp->size +
          |                             ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_multiboot_modstart':
    ../../i86pc/dboot/dboot_startkern.c:1025:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     1025 |   return (((mb_module_t *)mb_info->mods_addr)[index].mod_start);
          |            ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_multiboot_modend':
    ../../i86pc/dboot/dboot_startkern.c:1043:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     1043 |   return (((mb_module_t *)mb_info->mods_addr)[index].mod_end);
          |            ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_multiboot_modcmdline':
    ../../i86pc/dboot/dboot_startkern.c:1061:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     1061 |   return ((char *)((mb_module_t *)
          |                    ^
    ../../i86pc/dboot/dboot_startkern.c:1061:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     1061 |   return ((char *)((mb_module_t *)
          |           ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_multiboot1_highest_addr':
    ../../i86pc/dboot/dboot_startkern.c:1588:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     1588 |  char *cmdl = (char *)mb_info->cmdline;
          |               ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'process_efi32':
    ../../i86pc/dboot/dboot_startkern.c:1669:24: error: taking address of packed member of 'struct _EFI_CONFIGURATION_TABLE32' may result in an unaligned pointer value [-Werror=address-of-packed-member]
     1669 |   if (dboot_same_guids(&config[i].VendorGuid, &smbios3)) {
          |                        ^~~~~~~~~~~~~~~~~~~~~
    ../../i86pc/dboot/dboot_startkern.c:1674:24: error: taking address of packed member of 'struct _EFI_CONFIGURATION_TABLE32' may result in an unaligned pointer value [-Werror=address-of-packed-member]
     1674 |       dboot_same_guids(&config[i].VendorGuid, &smbios)) {
          |                        ^~~~~~~~~~~~~~~~~~~~~
    ../../i86pc/dboot/dboot_startkern.c:1678:24: error: taking address of packed member of 'struct _EFI_CONFIGURATION_TABLE32' may result in an unaligned pointer value [-Werror=address-of-packed-member]
     1678 |   if (dboot_same_guids(&config[i].VendorGuid, &acpi2)) {
          |                        ^~~~~~~~~~~~~~~~~~~~~
    ../../i86pc/dboot/dboot_startkern.c:1683:24: error: taking address of packed member of 'struct _EFI_CONFIGURATION_TABLE32' may result in an unaligned pointer value [-Werror=address-of-packed-member]
     1683 |       dboot_same_guids(&config[i].VendorGuid, &acpi1)) {
          |                        ^~~~~~~~~~~~~~~~~~~~~
    ../../i86pc/dboot/dboot_startkern.c: In function 'process_efi64':
    ../../i86pc/dboot/dboot_startkern.c:1702:24: error: taking address of packed member of 'struct _EFI_CONFIGURATION_TABLE64' may result in an unaligned pointer value [-Werror=address-of-packed-member]
     1702 |   if (dboot_same_guids(&config[i].VendorGuid, &smbios3)) {
          |                        ^~~~~~~~~~~~~~~~~~~~~
    ../../i86pc/dboot/dboot_startkern.c:1707:24: error: taking address of packed member of 'struct _EFI_CONFIGURATION_TABLE64' may result in an unaligned pointer value [-Werror=address-of-packed-member]
     1707 |       dboot_same_guids(&config[i].VendorGuid, &smbios)) {
          |                        ^~~~~~~~~~~~~~~~~~~~~
    ../../i86pc/dboot/dboot_startkern.c:1712:24: error: taking address of packed member of 'struct _EFI_CONFIGURATION_TABLE64' may result in an unaligned pointer value [-Werror=address-of-packed-member]
     1712 |   if (dboot_same_guids(&config[i].VendorGuid, &acpi2)) {
          |                        ^~~~~~~~~~~~~~~~~~~~~
    ../../i86pc/dboot/dboot_startkern.c:1717:24: error: taking address of packed member of 'struct _EFI_CONFIGURATION_TABLE64' may result in an unaligned pointer value [-Werror=address-of-packed-member]
     1717 |       dboot_same_guids(&config[i].VendorGuid, &acpi1)) {
          |                        ^~~~~~~~~~~~~~~~~~~~~
    ../../i86pc/dboot/dboot_startkern.c: In function 'print_efi64':
    ../../i86pc/dboot/dboot_startkern.c:1849:55: error: format '%lld' expects argument of type 'long long int', but argument 2 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
     1849 |  dboot_printf("EFI system table number of entries: %lld\n",
          |                                                    ~~~^
          |                                                       |
          |                                                       long long int
          |                                                    %ld
     1850 |      efi->NumberOfTableEntries);
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~
          |         |
          |         uint64_t {aka long unsigned int}
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_loader_cmdline':
    ../../i86pc/dboot/dboot_startkern.c:2164:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     2164 |    line = (char *)mb_info->cmdline;
          |           ^
    ../../i86pc/dboot/dboot_startkern.c: In function 'dboot_loader_name':
    ../../i86pc/dboot/dboot_startkern.c:2199:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     2199 |   return ((char *)mb_info->boot_loader_name);
          |           ^
    cc1: all warnings being treated as errors

    ../../i86pc/dboot/dboot_elfload.c: In function 'dboot_elfload64':
    ../../i86pc/dboot/dboot_elfload.c:185:18: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=]
      185 |     dboot_printf("zeroing BSS %ld bytes from " 
          |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ......
      189 |         next_addr + shdr->sh_size);
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~
          |                   |
          |                   long unsigned int
    ../../i86pc/dboot/dboot_elfload.c:186:36: note: format string is defined here
      186 |         "physaddr 0x%llx (end=0x%llx)\n",
          |                                 ~~~^
          |                                    |
          |                                    long long unsigned int
          |                                 %lx
    cc1: all warnings being treated as errors

Also available in: Atom PDF