From a06d7fe3fef5265bfcb7ac77867db0b13ce71b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 13 Mar 2015 10:36:55 +0000 Subject: [PATCH] Avoid possible spurious warning with gcc -Os Outline: if( condition ) foo = value; /* stuff that does not change condition */ if( condition ) /* use foo */ else /* don't use foo */ For some reason, it appears to only kick in with -Os with gcc 4.9.3 --- library/ssl_srv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/library/ssl_srv.c b/library/ssl_srv.c index ec806462d..bb66352bb 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -1677,17 +1677,14 @@ read_record_header: SSL_DEBUG_MSG( 2, ( "cookie verification skipped" ) ); } - } -#endif /* POLARSSL_SSL_PROTO_DTLS */ /* * Check the ciphersuitelist length (will be parsed later) */ -#if defined(POLARSSL_SSL_PROTO_DTLS) - if( ssl->transport == SSL_TRANSPORT_DATAGRAM ) ciph_offset = cookie_offset + 1 + cookie_len; + } else -#endif +#endif /* POLARSSL_SSL_PROTO_DTLS */ ciph_offset = 35 + sess_len; ciph_len = ( buf[ciph_offset + 0] << 8 )