Skip to content

Commit 7cbc0ea

Browse files
rtg-canonicaltorvalds
authored andcommitted
scripts/sortextable: suppress warning: `relocs_size' may be used uninitialized
In file included from scripts/sortextable.c:194:0: scripts/sortextable.c: In function `main': scripts/sortextable.h:176:3: warning: `relocs_size' may be used uninitialized in this function [-Wmaybe-uninitialized] memset(relocs, 0, relocs_size); ^ scripts/sortextable.h:106:6: note: `relocs_size' was declared here int relocs_size; ^ In file included from scripts/sortextable.c:192:0: scripts/sortextable.h:176:3: warning: `relocs_size' may be used uninitialized in this function [-Wmaybe-uninitialized] memset(relocs, 0, relocs_size); ^ scripts/sortextable.h:106:6: note: `relocs_size' was declared here int relocs_size; ^ gcc 4.9.1 Signed-off-by: Tim Gardner <[email protected]> Reviewed-by: Jamie Iles <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f9a4d11 commit 7cbc0ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: scripts/sortextable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ do_func(Elf_Ehdr *ehdr, char const *const fname, table_sort_t custom_sort)
103103
Elf_Sym *sort_needed_sym;
104104
Elf_Shdr *sort_needed_sec;
105105
Elf_Rel *relocs = NULL;
106-
int relocs_size;
106+
int relocs_size = 0;
107107
uint32_t *sort_done_location;
108108
const char *secstrtab;
109109
const char *strtab;

0 commit comments

Comments
 (0)