kpatch/kpatch-build
Joe Lawrence 25f12681fa create-diff-object: cleanup maybe-uninitialized compiler complaints
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>
2020-09-09 14:28:44 -04:00
..
gcc-plugins gcc-plugin: GCC 10 - update local/non local insn names 2020-06-12 13:27:06 +05:30
insn
Makefile kpatch-build/Makefile: Fail build on unsupported architectures 2020-07-20 18:37:00 +05:30
create-diff-object.c create-diff-object: cleanup maybe-uninitialized compiler complaints 2020-09-09 14:28:44 -04:00
create-klp-module.c lookup: rename 'pos' to 'sympos' 2020-04-06 15:18:58 -05:00
create-kpatch-module.c kpatch-build: Detect R_X86_64_64 dynrelas with large addends 2020-05-05 23:21:16 +03:00
kpatch-build kpatch-build: Check Final module symbols for loadability 2020-08-17 12:38:32 +01:00
kpatch-elf.c kpatch-build: Allow function to have multiple child functions 2020-03-30 14:14:17 +01:00
kpatch-elf.h kpatch-build: Allow function to have multiple child functions 2020-03-30 14:14:17 +01:00
kpatch-gcc Making kpatch-build compatible with custom gcc names 2019-05-09 19:15:11 +02:00
kpatch-intermediate.h lookup: rename 'pos' to 'sympos' 2020-04-06 15:18:58 -05:00
kpatch.h kpatch-build: add exit status enum 2018-06-15 07:11:48 -04:00
list.h
log.h kpatch-build: add exit status enum 2018-06-15 07:11:48 -04:00
lookup.c lookup: Add __UNIQUE_ID_ to maybe_discarded_sym list 2020-06-18 12:40:57 +05:30
lookup.h create-diff-object: refactor dynrela conversion 2020-04-06 15:18:58 -05:00