Skip to contentSkip to conversation

scripts: sortextable: change type and initialise variable

PATCH In review Klemen Jan Enova 2 participants 2 messages Jul 15, 2014 – Aug 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: sortextable: change type and initialise variable

Change the type of 'relocs_size' from 'int' to 'Elf32_Word' and initialize it to 0, to fix the "maybe uninitialised variable" compiler warning.

---

scripts/sortextable.h +1 -1
index 8fac3fd..537858d 100644
@@ -103,7 +103,7 @@ do_func(Elf_Ehdr *ehdr, char const *const fname, table_sort_
        Elf_Sym *sort_needed_sym;
        Elf_Shdr *sort_needed_sec;
        Elf_Rel *relocs = NULL;
-       int relocs_size;
+       Elf32_Word relocs_size = 0;
        uint32_t *sort_done_location;
        const char *secstrtab;
        const char *strtab;
#1 lore raw
Quoted 3 lines · Klemen Jan Enova

Change the type of 'relocs_size' from 'int' to 'Elf32_Word' and initialize it to 0, to fix the "maybe uninitialised variable" compiler warning.

Please include the verbatim warning in the commit message.

Quoted 8 lines

---

scripts/sortextable.h +0 -0
index 8fac3fd..537858d 100644
@@ -103,7 +103,7 @@ do_func(Elf_Ehdr *ehdr, char const *const fname, 

table_sort_

Your mailer corrupted the patch by inserting a line break here.

scripts/sortextable.h do_func(Elf_Ehdr *ehdr, char const *const fname, table_sort_ · line 106

Quoted 5 lines
         Elf_Sym *sort_needed_sym;
         Elf_Shdr *sort_needed_sec;
         Elf_Rel *relocs = NULL;
scripts/sortextable.h +1 -1
-       int relocs_size;
+       Elf32_Word relocs_size = 0;

... and changed tabs to spaces. Please send the patch to yourself first and see if it applies with 'git am.'

Michal