From 86d7e9902db7fcbbbc31aaa5b69bee82375caa21 Mon Sep 17 00:00:00 2001 From: Lev Stipakov Date: Fri, 18 Dec 2020 00:48:34 +0200 Subject: [PATCH] ssl_common.h: fix 'not all control paths return a value' msvc warning Commit cc5a71637 ("Replace key_scan array of static pointers with inline function") has introduced get_key_scan() routine with switch statement which calls ASSERT() in the default case. Even though "this should never happen", this code triggers Level 1 warning "not all control paths return a value" in msvc. Fix by adding "return NULL; /* NOTREACHED */" after ASSERT. Signed-off-by: Lev Stipakov Acked-by: Gert Doering Message-Id: <20201217224834.160-1-lstipakov@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21373.html Signed-off-by: Gert Doering --- src/openvpn/ssl_common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openvpn/ssl_common.h b/src/openvpn/ssl_common.h index f435089a4..a826e37f7 100644 --- a/src/openvpn/ssl_common.h +++ b/src/openvpn/ssl_common.h @@ -596,6 +596,7 @@ get_key_scan(struct tls_multi *multi, int index) return &multi->session[TM_LAME_DUCK].key[KS_LAME_DUCK]; default: ASSERT(false); + return NULL; /* NOTREACHED */ } } -- 2.47.2