aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2023-01-06 19:06:15 -0500
committerAaron Merey <amerey@redhat.com>2023-01-09 19:47:00 -0500
commit2ff63a29b0b01f949c8365f761e883d29709c44a (patch)
treec79de8fa9895a12326d59e2de77e61ae12c1ee82 /gdb
parent39bc472f4faf71906ece9c38f7401f7b950fc9df (diff)
downloadgdb-2ff63a29b0b01f949c8365f761e883d29709c44a.zip
gdb-2ff63a29b0b01f949c8365f761e883d29709c44a.tar.gz
gdb-2ff63a29b0b01f949c8365f761e883d29709c44a.tar.bz2
gdb/linespec.c: Fix -Wmaybe-uninitialized warning
Although the bool want_start_sal isn't actually used without being assigned a value, initialize it to be false in order to prevent the following -Wmaybe-uninitialized warning: linespec.c: In function ‘void minsym_found(linespec_state*, objfile*, minimal_symbol*, std::vector<symtab_and_line>*)’: linespec.c:4150:19: warning: ‘want_start_sal’ may be used uninitialized [-Wmaybe-uninitialized] 4150 | if (is_function && want_start_sal)
Diffstat (limited to 'gdb')
-rw-r--r--gdb/linespec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index e9339c3..b8c7754 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -4129,7 +4129,7 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
struct minimal_symbol *msymbol,
std::vector<symtab_and_line> *result)
{
- bool want_start_sal;
+ bool want_start_sal = false;
CORE_ADDR func_addr;
bool is_function = msymbol_is_function (objfile, msymbol, &func_addr);