consolidate handling of dead assignment warnings

This commit is contained in:
kaleb-himes
2016-04-11 13:39:44 -06:00
parent c6e9021732
commit 1b7cd5cb06
2 changed files with 18 additions and 18 deletions

View File

@ -1031,19 +1031,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
} }
#endif /* WOLFSSL_TRUST_PEER_CERT */ #endif /* WOLFSSL_TRUST_PEER_CERT */
} }
#else /* !NO_FILESYSTEM && !NO_CERTS */
(void) useClientCert;
(void) verifyCert;
(void) ourCert;
(void) ourKey;
#endif /* !NO_FILESYSTEM && !NO_CERTS */ #endif /* !NO_FILESYSTEM && !NO_CERTS */
#if !defined(NO_CERTS) #if !defined(NO_CERTS)
if (!usePsk && !useAnon && doPeerCheck == 0) if (!usePsk && !useAnon && doPeerCheck == 0)
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0); wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
if (!usePsk && !useAnon && overrideDateErrors == 1) if (!usePsk && !useAnon && overrideDateErrors == 1)
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, myDateCb); wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, myDateCb);
#else
(void) overrideDateErrors;
#endif #endif
#ifdef HAVE_CAVIUM #ifdef HAVE_CAVIUM
@ -1451,6 +1444,15 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
ShowMemoryTracker(); ShowMemoryTracker();
#endif /* USE_WOLFSSL_MEMORY */ #endif /* USE_WOLFSSL_MEMORY */
/* There are use cases when these assignments are not read. To avoid
* potential confusion those warnings have been handled here.
*/
(void) overrideDateErrors;
(void) useClientCert;
(void) verifyCert;
(void) ourCert;
(void) ourKey;
#if !defined(WOLFSSL_TIRTOS) #if !defined(WOLFSSL_TIRTOS)
return 0; return 0;
#endif #endif

View File

@ -639,8 +639,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
err_sys("can't load server cert file, check file and run from" err_sys("can't load server cert file, check file and run from"
" wolfSSL home dir"); " wolfSSL home dir");
} }
#else
(void) ourCert;
#endif #endif
#ifndef NO_DH #ifndef NO_DH
@ -662,9 +660,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
err_sys("can't load server private key file, check file and run " err_sys("can't load server private key file, check file and run "
"from wolfSSL home dir"); "from wolfSSL home dir");
} }
#else
(void) ourKey;
(void) useNtruKey;
#endif #endif
if (usePsk || usePskPlus) { if (usePsk || usePskPlus) {
@ -718,9 +713,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
} }
#endif /* WOLFSSL_TRUST_PEER_CERT */ #endif /* WOLFSSL_TRUST_PEER_CERT */
} }
#else
(void) verifyCert;
(void) doCliCertCheck;
#endif #endif
#if defined(CYASSL_SNIFFER) #if defined(CYASSL_SNIFFER)
@ -844,10 +836,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
#if !defined(NO_FILESYSTEM) && !defined(NO_DH) && !defined(NO_ASN) #if !defined(NO_FILESYSTEM) && !defined(NO_DH) && !defined(NO_ASN)
CyaSSL_SetTmpDH_file(ssl, ourDhParam, SSL_FILETYPE_PEM); CyaSSL_SetTmpDH_file(ssl, ourDhParam, SSL_FILETYPE_PEM);
#elif !defined(NO_DH) #elif !defined(NO_DH)
(void) ourDhParam;
SetDH(ssl); /* repick suites with DHE, higher priority than PSK */ SetDH(ssl); /* repick suites with DHE, higher priority than PSK */
#else
(void) ourDhParam;
#endif #endif
} }
@ -986,6 +975,15 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
TicketCleanup(); TicketCleanup();
#endif #endif
/* There are use cases when these assignments are not read. To avoid
* potential confusion those warnings have been handled here.
*/
(void) ourKey;
(void) verifyCert;
(void) doCliCertCheck;
(void) useNtruKey;
(void) ourDhParam;
(void) ourCert;
#ifndef CYASSL_TIRTOS #ifndef CYASSL_TIRTOS
return 0; return 0;
#endif #endif