make macros for pragma to compile with gcc11

This commit is contained in:
Elms
2021-06-08 19:20:20 -07:00
parent 7127dbeeec
commit 5a54bb656b
3 changed files with 12 additions and 12 deletions

View File

@ -14458,13 +14458,9 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
}
/* myBuffer may not initialized fully, but the sending length will be */
#if defined(__GNUC__) && __GNUC__ > 5
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"");
#endif
PRAGMA_GCC_IGNORE("GCC diagnostic ignored \"-Wmaybe-uninitialized\"");
ret = wolfSSL_write(ssl, myBuffer, sending);
#if defined(__GNUC__) && __GNUC__ > 5
_Pragma("GCC diagnostic pop");
#endif
PRAGMA_GCC_POP;
if (dynamic)
XFREE(myBuffer, ssl->heap, DYNAMIC_TYPE_WRITEV);

View File

@ -437,15 +437,11 @@ static int DeriveKey(WOLFSSL* ssl, byte* output, int outputLen,
hashOutSz = hashSz;
/* myBuffer may not initialized fully, but the sending length will be */
#if defined(__GNUC__) && __GNUC__ > 5
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"");
#endif
PRAGMA_GCC_IGNORE("GCC diagnostic ignored \"-Wmaybe-uninitialized\"");
return HKDF_Expand_Label(output, outputLen, secret, hashSz,
protocol, protocolLen, label, labelLen,
hash, hashOutSz, digestAlg);
#if defined(__GNUC__) && __GNUC__ > 5
_Pragma("GCC diagnostic pop");
#endif
PRAGMA_GCC_POP;
}
#ifndef NO_PSK

View File

@ -1053,6 +1053,14 @@ decouple library dependencies with standard string, memory and so on.
#define WC_MP_TO_RADIX
#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
} /* extern "C" */
#endif