Skip to content

Commit

Permalink
scripts/sortextable: suppress warning: `relocs_size' may be used unin…
Browse files Browse the repository at this point in the history
…itialized

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 <tim.gardner@canonical.com>
Reviewed-by: Jamie Iles <jamie.iles@oracle.com>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
rtg-canonical authored and hnaz committed Sep 26, 2014
1 parent d15f3b3 commit ec55c92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/sortextable.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ do_func(Elf_Ehdr *ehdr, char const *const fname, table_sort_t custom_sort)
Elf_Sym *sort_needed_sym;
Elf_Shdr *sort_needed_sec;
Elf_Rel *relocs = NULL;
int relocs_size;
int relocs_size = 0;
uint32_t *sort_done_location;
const char *secstrtab;
const char *strtab;
Expand Down

0 comments on commit ec55c92

Please sign in to comment.