diff options
author | Enze Li <enze.li@hotmail.com> | 2022-06-11 18:36:48 +0800 |
---|---|---|
committer | Enze Li <enze.li@hotmail.com> | 2022-07-08 21:48:15 +0800 |
commit | 44ca285b73b68f6a8fa3e89004b510d6b7d98e91 (patch) | |
tree | 34da7c1abb366a50d835c56fcf95356932f0ceef /gdb/python | |
parent | ec54dc915f42fa6f0da9902c333623f71d7aa5a3 (diff) | |
download | binutils-44ca285b73b68f6a8fa3e89004b510d6b7d98e91.zip binutils-44ca285b73b68f6a8fa3e89004b510d6b7d98e91.tar.gz binutils-44ca285b73b68f6a8fa3e89004b510d6b7d98e91.tar.bz2 |
gdb: initialize the data_head variable to eliminate compilation warnings
On a machine with gcc 12, I get this warning:
CXX nat/linux-btrace.o
In function ‘btrace_error linux_read_bts(btrace_data_bts*, btrace_target_info*, btrace_read_type)’,
inlined from ‘btrace_error linux_read_btrace(btrace_data*, btrace_target_info*, btrace_read_type)’ at ../gdb/nat/linux-btrace.c:935:29:
../gdb/nat/linux-btrace.c:865:21: warning: ‘data_head’ may be used uninitialized [-Wmaybe-uninitialized]
865 | pevent->last_head = data_head;
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../gdb/nat/linux-btrace.c: In function ‘btrace_error linux_read_btrace(btrace_data*, btrace_target_info*, btrace_read_type)’:
../gdb/nat/linux-btrace.c:792:9: note: ‘data_head’ was declared here
792 | __u64 data_head, data_tail;
| ^~~~~~~~~
Fix this by initializing the 'data_head' variable.
Tested by rebuilding on x86_64 openSUSE Tumbleweed with gcc 12.
Diffstat (limited to 'gdb/python')
0 files changed, 0 insertions, 0 deletions