From 9b7476c7c3631dd4453a27b526f8b5299ad078ac Mon Sep 17 00:00:00 2001 From: Robbie Shade Date: Tue, 9 Jan 2018 13:06:23 -0500 Subject: Explicitly handle all enum values in switch --- pb_decode.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pb_decode.c') diff --git a/pb_decode.c b/pb_decode.c index dc344dc..6223bea 100644 --- a/pb_decode.c +++ b/pb_decode.c @@ -351,6 +351,11 @@ static bool checkreturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire *size = 4; return pb_read(stream, buf, 4); + case PB_WT_STRING: + // Calling read_raw_value with a PB_WT_STRING is an error. + // Explicitly handle this case and fallthrough to default to avoid + // compiler warnings. + default: PB_RETURN_ERROR(stream, "invalid wire_type"); } } -- cgit v1.2.3