Fixed findings

List of Findings

Error: SHELLCHECK_WARNING (CWE-563): [#def1]
/usr/lib/kernel/install.d/55-set-boot-entry.install:7:1: warning[SC2034]: KERNEL_VERSION appears unused. Verify use (or export if used externally).
#    5|   
#    6|   COMMAND="$1"
#    7|-> KERNEL_VERSION="$2"
#    8|   BOOT_DIR_ABS="$3"
#    9|   KERNEL_IMAGE="$4"

Error: SHELLCHECK_WARNING (CWE-563): [#def2]
/usr/lib/kernel/install.d/55-set-boot-entry.install:8:1: warning[SC2034]: BOOT_DIR_ABS appears unused. Verify use (or export if used externally).
#    6|   COMMAND="$1"
#    7|   KERNEL_VERSION="$2"
#    8|-> BOOT_DIR_ABS="$3"
#    9|   KERNEL_IMAGE="$4"
#   10|   

Error: SHELLCHECK_WARNING (CWE-563): [#def3]
/usr/lib/kernel/install.d/55-set-boot-entry.install:9:1: warning[SC2034]: KERNEL_IMAGE appears unused. Verify use (or export if used externally).
#    7|   KERNEL_VERSION="$2"
#    8|   BOOT_DIR_ABS="$3"
#    9|-> KERNEL_IMAGE="$4"
#   10|   
#   11|   case "$COMMAND" in

Error: SHELLCHECK_WARNING (CWE-477): [#def4]
/usr/lib/kernel/install.d/55-set-boot-entry.install:26:49: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   24|                   [ -z "$(grub2-mkrelpath /boot)" ] && ROOTPREFIX="/boot"
#   25|   
#   26|->                 if [ -e "${ROOTPREFIX}${LINUX}" -a -n "${INITRD}" ]; then
#   27|                       if [ ! -e "${ROOTPREFIX}${INITRD}" ]; then
#   28|                           echo "Error: ${INITRD} not found"

Error: COMPILER_WARNING: [#def5]
grub-2.12/include/grub/dl.h:29: included_from: Included from here.
grub-2.12/grub-core/commands/efi/env.c:18: included_from: Included from here.
grub-2.12/grub-core/commands/efi/env.c: scope_hint: In function ‘grub_efi_export_env’
grub-2.12/grub-core/commands/efi/env.c:111:27: warning[-Wformat=]: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘grub_size_t’ {aka ‘unsigned int’}
#  111 |   grub_dprintf ("efienv", "envblk is %lu bytes:\n\"%s\"\n", envblk_s.size, envblk_s.buf);
#      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~
#      |                                                                     |
#      |                                                                     grub_size_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/commands/efi/env.c:111:40: note: format string is defined here
#  111 |   grub_dprintf ("efienv", "envblk is %lu bytes:\n\"%s\"\n", envblk_s.size, envblk_s.buf);
#      |                                      ~~^
#      |                                        |
#      |                                        long unsigned int
#      |                                      %u
#  109|       }
#  110|   
#  111|->   grub_dprintf ("efienv", "envblk is %lu bytes:\n\"%s\"\n", envblk_s.size, envblk_s.buf);
#  112|   
#  113|     grub_dprintf ("efienv", "removing GRUB_ENV\n");

Error: COMPILER_WARNING: [#def6]
grub-2.12/grub-core/commands/efi/env.c:116:29: warning[-Wformat=]: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘grub_efi_status_t’ {aka ‘unsigned int’}
#  116 |     grub_dprintf ("efienv", "removal returned %ld\n", status);
#      |                             ^~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
#      |                                                       |
#      |                                                       grub_efi_status_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/commands/efi/env.c:116:49: note: format string is defined here
#  116 |     grub_dprintf ("efienv", "removal returned %ld\n", status);
#      |                                               ~~^
#      |                                                 |
#      |                                                 long int
#      |                                               %d
#  114|     status = grub_efi_set_variable ("GRUB_ENV", &grub_env_guid, NULL, 0);
#  115|     if (status != GRUB_EFI_SUCCESS)
#  116|->     grub_dprintf ("efienv", "removal returned %ld\n", status);
#  117|   
#  118|     grub_dprintf ("efienv", "setting GRUB_ENV\n");

Error: COMPILER_WARNING: [#def7]
grub-2.12/grub-core/commands/efi/env.c:122:29: warning[-Wformat=]: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘grub_efi_status_t’ {aka ‘unsigned int’}
#  122 |     grub_dprintf ("efienv", "setting GRUB_ENV returned %ld\n", status);
#      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
#      |                                                                |
#      |                                                                grub_efi_status_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/commands/efi/env.c:122:58: note: format string is defined here
#  122 |     grub_dprintf ("efienv", "setting GRUB_ENV returned %ld\n", status);
#      |                                                        ~~^
#      |                                                          |
#      |                                                          long int
#      |                                                        %d
#  120|   				  envblk_s.buf, envblk_s.size);
#  121|     if (status != GRUB_EFI_SUCCESS)
#  122|->     grub_dprintf ("efienv", "setting GRUB_ENV returned %ld\n", status);
#  123|   
#  124|     return 0;

Error: COMPILER_WARNING: [#def8]
grub-2.12/grub-core/kern/efi/mm.c:20: included_from: Included from here.
grub-2.12/grub-core/kern/efi/mm.c: scope_hint: In function ‘grub_efi_allocate_pages_real’
grub-2.12/grub-core/kern/efi/mm.c:177:21: warning[-Wformat=]: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘grub_efi_uintn_t’ {aka ‘unsigned int’}
#  177 |                     "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  178 |                     alloctype, memtype, pages, address, status);
#      |                                         ~~~~~
#      |                                         |
#      |                                         grub_efi_uintn_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/kern/efi/mm.c:177:50: note: format string is defined here
#  177 |                     "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#      |                                               ~~~^
#      |                                                  |
#      |                                                  long unsigned int
#      |                                               %0x
#  175|       {
#  176|         grub_dprintf ("efi",
#  177|-> 		    "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#  178|   		    alloctype, memtype, pages, address, status);
#  179|         grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));

Error: COMPILER_WARNING: [#def9]
grub-2.12/grub-core/kern/efi/mm.c:177:21: warning[-Wformat=]: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘grub_efi_physical_address_t’ {aka ‘long long unsigned int’}
#  177 |                     "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  178 |                     alloctype, memtype, pages, address, status);
#      |                                                ~~~~~~~
#      |                                                |
#      |                                                grub_efi_physical_address_t {aka long long unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/kern/efi/mm.c:177:60: note: format string is defined here
#  177 |                     "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#      |                                                       ~~~~~^
#      |                                                            |
#      |                                                            long unsigned int
#      |                                                       %016llx
#  175|       {
#  176|         grub_dprintf ("efi",
#  177|-> 		    "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#  178|   		    alloctype, memtype, pages, address, status);
#  179|         grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));

Error: COMPILER_WARNING: [#def10]
grub-2.12/grub-core/kern/efi/mm.c:177:21: warning[-Wformat=]: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘grub_efi_status_t’ {aka ‘unsigned int’}
#  177 |                     "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  178 |                     alloctype, memtype, pages, address, status);
#      |                                                         ~~~~~~
#      |                                                         |
#      |                                                         grub_efi_status_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/kern/efi/mm.c:177:72: note: format string is defined here
#  177 |                     "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#      |                                                                   ~~~~~^
#      |                                                                        |
#      |                                                                        long unsigned int
#      |                                                                   %016x
#  175|       {
#  176|         grub_dprintf ("efi",
#  177|-> 		    "allocate_pages(%d, %d, 0x%0lx, 0x%016lx) = 0x%016lx\n",
#  178|   		    alloctype, memtype, pages, address, status);
#  179|         grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));

Error: COMPILER_WARNING: [#def11]
grub-2.12/grub-core/kern/efi/mm.c: scope_hint: In function ‘grub_nx_init’
grub-2.12/grub-core/kern/efi/mm.c:628:21: warning[-Wformat=]: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘grub_addr_t’ {aka ‘unsigned int’}
#  628 |                     "grub_get_mem_attrs(0x%"PRIxGRUB_UINT64_T", ...) -> 0x%x\n",
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
#  629 |                     stack_current, err);
#      |                     ~~~~~~~~~~~~~
#      |                     |
#      |                     grub_addr_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
#  626|       {
#  627|         grub_dprintf ("nx",
#  628|-> 		    "grub_get_mem_attrs(0x%"PRIxGRUB_UINT64_T", ...) -> 0x%x\n",
#  629|   		    stack_current, err);
#  630|         grub_error_pop ();

Error: COMPILER_WARNING: [#def12]
grub-2.12/grub-core/kern/efi/mm.c:644:21: warning[-Wformat=]: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘grub_addr_t’ {aka ‘unsigned int’}
#  644 |                     "grub_get_mem_attrs(0x%"PRIxGRUB_UINT64_T", ...) -> 0x%x\n",
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
#  645 |                     stack_current, err);
#      |                     ~~~~~~~~~~~~~
#      |                     |
#      |                     grub_addr_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
#  642|       {
#  643|         grub_dprintf ("nx",
#  644|-> 		    "grub_get_mem_attrs(0x%"PRIxGRUB_UINT64_T", ...) -> 0x%x\n",
#  645|   		    stack_current, err);
#  646|         grub_error_pop ();

Error: COMPILER_WARNING: [#def13]
grub-2.12/grub-core/kern/efi/mm.c:665:25: warning[-Wformat=]: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘grub_addr_t’ {aka ‘unsigned int’}
#  665 |                         "grub_get_mem_attrs(0x%"PRIxGRUB_UINT64_T", ...) -> 0x%x\n",
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
#  666 |                         stack_current, err);
#      |                         ~~~~~~~~~~~~~
#      |                         |
#      |                         grub_addr_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
#  663|   	{
#  664|   	  grub_dprintf ("nx",
#  665|-> 			"grub_get_mem_attrs(0x%"PRIxGRUB_UINT64_T", ...) -> 0x%x\n",
#  666|   			stack_current, err);
#  667|   	  grub_error_pop ();

Error: COMPILER_WARNING: [#def14]
grub-2.12/grub-core/kern/efi/mm.c: scope_hint: In function ‘grub_get_mem_attrs’
grub-2.12/grub-core/kern/efi/mm.c:871:27: warning[-Wformat=]: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘grub_efi_physical_address_t’ {aka ‘long long unsigned int’}
#  871 |       grub_dprintf ("nx", "%s called on 0x%"PRIxGRUB_ADDR"-0x%"PRIxGRUB_ADDR" and attrs %p\n",
#      |                           ^~~~~~~~~~~~~~~~~~
#  872 |                     __func__, physaddr, physaddr+size-1, attrs);
#      |                               ~~~~~~~~
#      |                               |
#      |                               grub_efi_physical_address_t {aka long long unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/kern/efi/mm.c:871:44: note: format string is defined here
#  871 |       grub_dprintf ("nx", "%s called on 0x%"PRIxGRUB_ADDR"-0x%"PRIxGRUB_ADDR" and attrs %p\n",
#      |                                           ~^
#      |                                            |
#      |                                            unsigned int
#      |                                           %llx
#  869|     if (physaddr & 0xfff || size & 0xfff || size == 0 || attrs == NULL)
#  870|       {
#  871|->       grub_dprintf ("nx", "%s called on 0x%"PRIxGRUB_ADDR"-0x%"PRIxGRUB_ADDR" and attrs %p\n",
#  872|   		    __func__, physaddr, physaddr+size-1, attrs);
#  873|         return 0;

Error: COMPILER_WARNING: [#def15]
grub-2.12/grub-core/kern/efi/mm.c: scope_hint: In function ‘grub_update_mem_attrs’
grub-2.12/grub-core/kern/efi/mm.c:905:27: warning[-Wformat=]: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘grub_efi_physical_address_t’ {aka ‘long long unsigned int’}
#  905 |       grub_dprintf ("nx", "%s called on 0x%"PRIxGRUB_ADDR"-0x%"PRIxGRUB_ADDR" +%s%s%s -%s%s%s\n",
#      |                           ^~~~~~~~~~~~~~~~~~
#  906 |                     __func__, physaddr, physaddr + size - 1,
#      |                               ~~~~~~~~
#      |                               |
#      |                               grub_efi_physical_address_t {aka long long unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/kern/efi/mm.c:905:44: note: format string is defined here
#  905 |       grub_dprintf ("nx", "%s called on 0x%"PRIxGRUB_ADDR"-0x%"PRIxGRUB_ADDR" +%s%s%s -%s%s%s\n",
#      |                                           ~^
#      |                                            |
#      |                                            unsigned int
#      |                                           %llx
#  903|     if (physaddr & 0xfff || size & 0xfff || size == 0)
#  904|       {
#  905|->       grub_dprintf ("nx", "%s called on 0x%"PRIxGRUB_ADDR"-0x%"PRIxGRUB_ADDR" +%s%s%s -%s%s%s\n",
#  906|   		    __func__, physaddr, physaddr + size - 1,
#  907|   		    (set_attrs & GRUB_MEM_ATTR_R) ? "r" : "",

Error: COMPILER_WARNING: [#def16]
grub-2.12/grub-core/kern/efi/mm.c:917:23: warning[-Wformat=]: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘grub_uint64_t’ {aka ‘long long unsigned int’}
#  917 |   grub_dprintf ("nx", "translating set_attrs from 0x%lx to 0x%lx\n", set_attrs, uefi_set_attrs);
#      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~
#      |                                                                      |
#      |                                                                      grub_uint64_t {aka long long unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/kern/efi/mm.c:917:55: note: format string is defined here
#  917 |   grub_dprintf ("nx", "translating set_attrs from 0x%lx to 0x%lx\n", set_attrs, uefi_set_attrs);
#      |                                                     ~~^
#      |                                                       |
#      |                                                       long unsigned int
#      |                                                     %llx
#  915|   
#  916|     uefi_set_attrs = grub_mem_attrs_to_uefi_mem_attrs (set_attrs);
#  917|->   grub_dprintf ("nx", "translating set_attrs from 0x%lx to 0x%lx\n", set_attrs, uefi_set_attrs);
#  918|     uefi_clear_attrs = grub_mem_attrs_to_uefi_mem_attrs (clear_attrs);
#  919|     grub_dprintf ("nx", "translating clear_attrs from 0x%lx to 0x%lx\n", clear_attrs, uefi_clear_attrs);

Error: COMPILER_WARNING: [#def17]
grub-2.12/grub-core/kern/efi/mm.c:919:23: warning[-Wformat=]: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘grub_uint64_t’ {aka ‘long long unsigned int’}
#  919 |   grub_dprintf ("nx", "translating clear_attrs from 0x%lx to 0x%lx\n", clear_attrs, uefi_clear_attrs);
#      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~
#      |                                                                        |
#      |                                                                        grub_uint64_t {aka long long unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/kern/efi/mm.c:919:57: note: format string is defined here
#  919 |   grub_dprintf ("nx", "translating clear_attrs from 0x%lx to 0x%lx\n", clear_attrs, uefi_clear_attrs);
#      |                                                       ~~^
#      |                                                         |
#      |                                                         long unsigned int
#      |                                                       %llx
#  917|     grub_dprintf ("nx", "translating set_attrs from 0x%lx to 0x%lx\n", set_attrs, uefi_set_attrs);
#  918|     uefi_clear_attrs = grub_mem_attrs_to_uefi_mem_attrs (clear_attrs);
#  919|->   grub_dprintf ("nx", "translating clear_attrs from 0x%lx to 0x%lx\n", clear_attrs, uefi_clear_attrs);
#  920|     if (uefi_set_attrs)
#  921|       efi_status = proto->set_memory_attributes(

Error: COMPILER_WARNING: [#def18]
grub-2.12/include/grub/dl.h:29: included_from: Included from here.
grub-2.12/include/grub/fs.h:26: included_from: Included from here.
grub-2.12/include/grub/file.h:25: included_from: Included from here.
grub-2.12/include/grub/loader.h:23: included_from: Included from here.
grub-2.12/grub-core/loader/efi/chainloader.c:22: included_from: Included from here.
grub-2.12/grub-core/loader/efi/chainloader.c: scope_hint: In function ‘handle_image’
grub-2.12/grub-core/loader/efi/chainloader.c:830:26: warning[-Wformat=]: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘grub_efi_status_t’ {aka ‘unsigned int’}
#  830 |   grub_dprintf ("chain", "entry_point returned %ld\n", efi_status);
#      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~
#      |                                                        |
#      |                                                        grub_efi_status_t {aka unsigned int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/loader/efi/chainloader.c:830:50: note: format string is defined here
#  830 |   grub_dprintf ("chain", "entry_point returned %ld\n", efi_status);
#      |                                                ~~^
#      |                                                  |
#      |                                                  long int
#      |                                                %d
#  828|                               grub_efi_system_table);
#  829|   
#  830|->   grub_dprintf ("chain", "entry_point returned %ld\n", efi_status);
#  831|     grub_memcpy (li, &li_bak, sizeof (grub_efi_loaded_image_t));
#  832|     efi_status = b->free_pool (buffer);

Error: COMPILER_WARNING: [#def19]
grub-2.12/grub-core/loader/efi/chainloader.c: scope_hint: In function ‘grub_cmd_chainloader’
grub-2.12/grub-core/loader/efi/chainloader.c:1085:22: warning[-Wformat=]: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘grub_ssize_t’ {aka ‘int’}
# 1085 |   grub_dprintf("nx", "setting attributes for %p (%lu bytes) to %llx\n",
#      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1086 |                (void *)(grub_addr_t)address, fsize, 0llu);
#      |                                              ~~~~~
#      |                                              |
#      |                                              grub_ssize_t {aka int}
grub-2.12/include/grub/misc.h:46:88: note: in definition of macro ‘grub_dprintf’
#   46 | #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
#      |                                                                                        ^~~~~~~~~~~
grub-2.12/grub-core/loader/efi/chainloader.c:1085:52: note: format string is defined here
# 1085 |   grub_dprintf("nx", "setting attributes for %p (%lu bytes) to %llx\n",
#      |                                                  ~~^
#      |                                                    |
#      |                                                    long unsigned int
#      |                                                  %u
# 1083|      * in doing anything but clearing the protection bits here.
# 1084|      */
# 1085|->   grub_dprintf("nx", "setting attributes for %p (%lu bytes) to %llx\n",
# 1086|   	       (void *)(grub_addr_t)address, fsize, 0llu);
# 1087|     grub_update_mem_attrs (address, fsize,

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-159.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namegrub2-2.12-50.fc44
diffbase-store-results-to/tmp/tmpss_tvdwa/grub2-2.12-50.fc44.tar.xz
diffbase-time-created2026-01-08 17:20:08
diffbase-time-finished2026-01-08 17:50:57
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpss_tvdwa/grub2-2.12-50.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpss_tvdwa/grub2-2.12-50.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-159.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namegrub2-2.12-40.fc43
store-results-to/tmp/tmpcn0f1it8/grub2-2.12-40.fc43.tar.xz
time-created2026-01-08 16:48:18
time-finished2026-01-08 17:19:37
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpcn0f1it8/grub2-2.12-40.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpcn0f1it8/grub2-2.12-40.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9