From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2009) id 30CF63858CDA; Tue, 10 Jan 2023 01:13:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30CF63858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673313182; bh=MAwL5rb3owFYVSyaLN1Ta4+dy39cWD0THR9UDOQf1Ho=; h=From:To:Subject:Date:From; b=xtJBXNEDgynMYn46cNyiBRAx7QOMqjOfhEBVTM0iXfYD96retF/6uqDYfmKvn1CYR zR7lcC3bhx7slpxxO3sK1VrNFwGmeZyJl8/gxIA76W0gB05VEtAJem+p6n5VyVcJBx D9vh6bnE+8HmvxTtk4EQqihCBufQC8nCbb/IpKDU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Aaron Merey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/linespec.c: Fix -Wmaybe-uninitialized warning X-Act-Checkin: binutils-gdb X-Git-Author: Aaron Merey X-Git-Refname: refs/heads/master X-Git-Oldrev: 39bc472f4faf71906ece9c38f7401f7b950fc9df X-Git-Newrev: 2ff63a29b0b01f949c8365f761e883d29709c44a Message-Id: <20230110011302.30CF63858CDA@sourceware.org> Date: Tue, 10 Jan 2023 01:13:02 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2ff63a29b0b0= 1f949c8365f761e883d29709c44a commit 2ff63a29b0b01f949c8365f761e883d29709c44a Author: Aaron Merey Date: Fri Jan 6 19:06:15 2023 -0500 gdb/linespec.c: Fix -Wmaybe-uninitialized warning =20 Although the bool want_start_sal isn't actually used without being assi= gned a value, initialize it to be false in order to prevent the following -Wmaybe-uninitialized warning: =20 linespec.c: In function =E2=80=98void minsym_found(linespec_state*,= objfile*, minimal_symbol*, std::vector*)=E2=80=99: linespec.c:4150:19: warning: =E2=80=98want_start_sal=E2=80=99 may b= e used uninitialized [-Wmaybe-uninitialized] 4150 | if (is_function && want_start_sal) Diff: --- 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 obj= file *objfile, struct minimal_symbol *msymbol, std::vector *result) { - bool want_start_sal; + bool want_start_sal =3D false; =20 CORE_ADDR func_addr; bool is_function =3D msymbol_is_function (objfile, msymbol, &func_addr);