public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Suppress uninitialized candidate_type warning in process_traits_for_candidates
@ 2021-08-15 16:05 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2021-08-15 16:05 UTC (permalink / raw)
  To: gcc-rust; +Cc: Mark Wielaard

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-15 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 16:05 [PATCH] Suppress uninitialized candidate_type warning in process_traits_for_candidates Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).