From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 3D3E13858C3A for ; Sun, 15 Aug 2021 16:05:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3D3E13858C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (unknown [172.31.128.28]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 67A1C302FBB1; Sun, 15 Aug 2021 18:05:20 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id C954A2E81E01; Sun, 15 Aug 2021 18:05:19 +0200 (CEST) From: Mark Wielaard To: gcc-rust@gcc.gnu.org Cc: Mark Wielaard Subject: [PATCH] Suppress uninitialized candidate_type warning in process_traits_for_candidates Date: Sun, 15 Aug 2021 18:05:04 +0200 Message-Id: <20210815160504.12607-1-mark@klomp.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2021 16:05:23 -0000 Without handling the default case in the switch statement gcc 10.2.1 will warn: rust-hir-path-probe.h:75:40: warning: ‘candidate_type’ may be used uninitialized in this function [-Wmaybe-uninitialized] --- gcc/rust/typecheck/rust-hir-path-probe.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/typecheck/rust-hir-path-probe.h b/gcc/rust/typecheck/rust-hir-path-probe.h index 87c96628118..22b10741094 100644 --- a/gcc/rust/typecheck/rust-hir-path-probe.h +++ b/gcc/rust/typecheck/rust-hir-path-probe.h @@ -260,6 +260,7 @@ private: break; case TraitItemReference::TraitItemType::ERROR: + default: gcc_unreachable (); break; } -- 2.32.0