mirror of https://github.com/dynup/kpatch
25f12681fa
User disaster123 reports the following build errors: create-diff-object.c: In function 'kpatch_process_special_sections': create-diff-object.c:2215:41: error: 'key' may be used uninitialized in this function [-Werror=maybe-uninitialized] code->sym->name, code->addend, key->sym->name); ^~ create-diff-object.c:2138:22: note: 'key' was declared here struct rela *code, *key, *rela; ^~~ In file included from kpatch-elf.h:26, from create-diff-object.c:53: log.h:20:3: error: 'code' may be used uninitialized in this function [-Werror=maybe-uninitialized] printf(format, ##__VA_ARGS__); \ ^~~~~~ create-diff-object.c:2138:15: note: 'code' was declared here struct rela *code, *key, *rela; ^~~~ cc1: all warnings being treated as errors These are reproducible when building with 9.3.1 and 8.3.1 when building with optimization level > 2 ( CFLAGS=-O2 make ). Fix them by initializing the reported variables to NULL and verifying that they are infact non-NULL after processing the __jump_table. Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com> |
||
---|---|---|
.. | ||
gcc-plugins | ||
insn | ||
Makefile | ||
create-diff-object.c | ||
create-klp-module.c | ||
create-kpatch-module.c | ||
kpatch-build | ||
kpatch-elf.c | ||
kpatch-elf.h | ||
kpatch-gcc | ||
kpatch-intermediate.h | ||
kpatch.h | ||
list.h | ||
log.h | ||
lookup.c | ||
lookup.h |