Merge pull request #4052 from elms/gcc11_fixes

fixes for gcc 11 compile and other whitespace
This commit is contained in:
Sean Parkinson
2021-06-10 15:51:04 +10:00
committed by GitHub
4 changed files with 62 additions and 47 deletions

View File

@@ -14467,7 +14467,10 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
idx += (int)iov[i].iov_len; idx += (int)iov[i].iov_len;
} }
/* myBuffer may not initialized fully, but the sending length will be */
PRAGMA_GCC_IGNORE("GCC diagnostic ignored \"-Wmaybe-uninitialized\"");
ret = wolfSSL_write(ssl, myBuffer, sending); ret = wolfSSL_write(ssl, myBuffer, sending);
PRAGMA_GCC_POP;
if (dynamic) if (dynamic)
XFREE(myBuffer, ssl->heap, DYNAMIC_TYPE_WRITEV); XFREE(myBuffer, ssl->heap, DYNAMIC_TYPE_WRITEV);

View File

@@ -421,6 +421,7 @@ static int DeriveKey(WOLFSSL* ssl, byte* output, int outputLen,
#endif #endif
default: default:
ret = HASH_TYPE_E;
break; break;
} }
if (ret != 0) if (ret != 0)
@@ -435,9 +436,12 @@ static int DeriveKey(WOLFSSL* ssl, byte* output, int outputLen,
if (includeMsgs) if (includeMsgs)
hashOutSz = hashSz; hashOutSz = hashSz;
/* myBuffer may not initialized fully, but the sending length will be */
PRAGMA_GCC_IGNORE("GCC diagnostic ignored \"-Wmaybe-uninitialized\"");
return HKDF_Expand_Label(output, outputLen, secret, hashSz, return HKDF_Expand_Label(output, outputLen, secret, hashSz,
protocol, protocolLen, label, labelLen, protocol, protocolLen, label, labelLen,
hash, hashOutSz, digestAlg); hash, hashOutSz, digestAlg);
PRAGMA_GCC_POP;
} }
#ifndef NO_PSK #ifndef NO_PSK

View File

@@ -1053,6 +1053,14 @@ decouple library dependencies with standard string, memory and so on.
#define WC_MP_TO_RADIX #define WC_MP_TO_RADIX
#endif #endif
#if defined(__GNUC__) && __GNUC__ > 5
#define PRAGMA_GCC_IGNORE(str) _Pragma(str);
#define PRAGMA_GCC_POP _Pragma("GCC diagnostic pop");
#else
#define PRAGMA_GCC_IGNORE(str)
#define PRAGMA_GCC_POP
#endif
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif