From 2ff63a29b0b01f949c8365f761e883d29709c44a Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Fri, 6 Jan 2023 19:06:15 -0500 Subject: [PATCH] gdb/linespec.c: Fix -Wmaybe-uninitialized warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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*)’: linespec.c:4150:19: warning: ‘want_start_sal’ may be used uninitialized [-Wmaybe-uninitialized] 4150 | if (is_function && want_start_sal) --- gdb/linespec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/linespec.c b/gdb/linespec.c index e9339c3338c..b8c77541a29 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 *result) { - bool want_start_sal; + bool want_start_sal = false; CORE_ADDR func_addr; bool is_function = msymbol_is_function (objfile, msymbol, &func_addr); -- 2.30.2