aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/expr.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-10-12 11:07:24 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-10-19 14:32:21 +0100
commitcb9d1609da6e623158ba5a8cb4a2712bcea4f57f (patch)
tree3dca6e374b50714643a347533a3074cd4a1d1653 /gdb/dwarf2/expr.c
parent2b06e59de0675c2cb526af2de6803dae29703d15 (diff)
downloadbinutils-cb9d1609da6e623158ba5a8cb4a2712bcea4f57f.zip
binutils-cb9d1609da6e623158ba5a8cb4a2712bcea4f57f.tar.gz
binutils-cb9d1609da6e623158ba5a8cb4a2712bcea4f57f.tar.bz2
sim/cgen: mask uninitialized variable warning in cgen-run.c
I see an uninitialized variable warning (with gcc 9.3.1) from cgen-run.c, like this: /tmp/build/sim/../../src/sim/cris/../common/cgen-run.c: In function ‘sim_resume’: /tmp/build/sim/../../src/sim/cris/../common/cgen-run.c:259:5: warning: ‘engine_fns$’ may be used uninitialized in this function [-Wmaybe-uninitialized] 259 | (* engine_fns[next_cpu_nr]) (cpu); | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/build/sim/../../src/sim/cris/../common/cgen-run.c:232:14: note: ‘engine_fns$’ was declared here 232 | ENGINE_FN *engine_fns[MAX_NR_PROCESSORS]; | ^~~~~~~~~~ This is a false positive - we over allocate engine_fn, and then only initialize the nr_cpus entries which we will later go on to use. However, we can easily silence this warning by initializing the unused entries in engine_fns to NULL, this might also help if anyone ever looks at engine_fns in a debugger, it should now be obvious which entries are in use, and which are not. With this change the warning is gone. There should be no change in behaviour with this commit.
Diffstat (limited to 'gdb/dwarf2/expr.c')
0 files changed, 0 insertions, 0 deletions