From: Tim Gardner Date: Tue, 24 Nov 2015 08:04:15 +0000 (+0100) Subject: scripts/sortextable: suppress warning: `relocs_size' may be used uninitialized X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=59ce4bb9a0c0a008aac229bdf7b25fea3a3e102e;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Change-Id: I50749f95f1e212ed8c913547bffed14f847b8929 --- diff --git a/scripts/sortextable.h b/scripts/sortextable.h index f5eb43d4292..3f064799a8c 100644 --- a/scripts/sortextable.h +++ b/scripts/sortextable.h @@ -101,7 +101,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;