From: Lev Stipakov Date: Thu, 17 Dec 2020 22:48:34 +0000 (+0200) Subject: ssl_common.h: fix 'not all control paths return a value' msvc warning X-Git-Tag: v2.6_beta1~643 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86d7e9902db7fcbbbc31aaa5b69bee82375caa21;p=thirdparty%2Fopenvpn.git 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 --- 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 */ } }