mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
libctf: work around an uninitialized variable warning
GCC 11+ complains that sym is uninitialized in ctf_symbol_next. It isn't, but it's not quite smart enough to figure that out (it requires domain-specific knowledge of the state of the ctf_next_t iterator over multiple calls). libctf/ * ctf-lookup.c (ctf_symbol_next): Initialize sym to a suitable value for returning if never reset during the function.
This commit is contained in:
@@ -651,7 +651,7 @@ ctf_id_t
|
||||
ctf_symbol_next (ctf_dict_t *fp, ctf_next_t **it, const char **name,
|
||||
int functions)
|
||||
{
|
||||
ctf_id_t sym;
|
||||
ctf_id_t sym = CTF_ERR;
|
||||
ctf_next_t *i = *it;
|
||||
int err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user