From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id EE8B63858C2D for ; Sat, 7 Jan 2023 00:49:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE8B63858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673052588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j374vIriHjIRjedJLRpjx2kKvOSFLF2vvolyXTwkSdY=; b=KLHoNvEzYlHPa4ANvgGOF8ZKLqHKXB2SRQWxyCHZEXe1KKQVVT952rplY8qVqNYXckkgRS OQO6VvP7C0cxHeGReYDkJdkQDPea77/Msjh5bFvSBmDPhWQnQh0Y2MVcSmS9CcWfL4WaU6 hMPMLoGM7Sse0HPM9aar9xwGkpoXgC0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-299-LQivJsQIOSC4nUkXN4rMjA-1; Fri, 06 Jan 2023 19:49:47 -0500 X-MC-Unique: LQivJsQIOSC4nUkXN4rMjA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34E3A3C38FE2 for ; Sat, 7 Jan 2023 00:49:47 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.34.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 037062166B30; Sat, 7 Jan 2023 00:49:46 +0000 (UTC) From: Aaron Merey To: gdb-patches@sourceware.org Cc: Aaron Merey Subject: [PATCH] gdb/linespec.c: Fix -Wmaybe-uninitialized warning Date: Fri, 6 Jan 2023 19:49:41 -0500 Message-Id: <20230107004941.589074-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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.39.0