diff options
-rw-r--r-- | tests/gnutls_record_overhead.c | 5 | ||||
-rw-r--r-- | tests/ocsp-common.h | 9 | ||||
-rw-r--r-- | tests/test-chains.h | 10 | ||||
-rw-r--r-- | tests/tls13/ext-parse.h | 9 |
4 files changed, 32 insertions, 1 deletions
diff --git a/tests/gnutls_record_overhead.c b/tests/gnutls_record_overhead.c index f07f0b232b..541d7c5e82 100644 --- a/tests/gnutls_record_overhead.c +++ b/tests/gnutls_record_overhead.c @@ -48,8 +48,11 @@ #define gnutls_assert() #define gnutls_assert_val(val) val +/* #pragma doesn't work to suppress preprocessor warnings like -Wunused-macros. + * So we just use the above defined macros here. */ +#if defined _gnutls_debug_log && defined gnutls_assert && defined gnutls_assert_val #include "../lib/algorithms.h" - +#endif unsigned _gnutls_record_overhead(const version_entry_st *ver, const cipher_entry_st *cipher, diff --git a/tests/ocsp-common.h b/tests/ocsp-common.h index 81b3e43b16..e17eea1e68 100644 --- a/tests/ocsp-common.h +++ b/tests/ocsp-common.h @@ -23,6 +23,11 @@ #ifndef OCSP_COMMON_H #define OCSP_COMMON_H +#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" +#endif + /* Date for responses to be valid */ #define OCSP_RESP_DATE 1508329639 @@ -575,4 +580,8 @@ static gnutls_datum_t ocsp_subca3_unknown_pem = { (void *)_ocsp_subca3_unknown_pem, sizeof(_ocsp_subca3_unknown_pem)-1 }; +#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# pragma GCC diagnostic pop +#endif + #endif diff --git a/tests/test-chains.h b/tests/test-chains.h index d00f8b3b65..934d743c0d 100644 --- a/tests/test-chains.h +++ b/tests/test-chains.h @@ -3773,6 +3773,11 @@ static const char *tls_feat_superset[] = { NULL }; +#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" +#endif + static struct { const char *name; @@ -3925,4 +3930,9 @@ static struct { "rsa pss: chain with changing hashes - ok", rsa_pss_chain_sha512_sha384_sha256_ok, &rsa_pss_chain_sha512_sha384_sha256_ok[3], 0, 0, 0, 1501159136}, { NULL, NULL, NULL, 0, 0} }; + +#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# pragma GCC diagnostic pop +#endif + /* *INDENT-ON* */ diff --git a/tests/tls13/ext-parse.h b/tests/tls13/ext-parse.h index ff8a200768..ae9c1c8afb 100644 --- a/tests/tls13/ext-parse.h +++ b/tests/tls13/ext-parse.h @@ -44,6 +44,11 @@ typedef void (*ext_parse_func)(void *priv, gnutls_datum_t *extdata); #define HANDSHAKE_SESSION_ID_POS 34 +#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-function" +#endif + /* Returns 0 if the extension was not found, 1 otherwise. */ static unsigned find_client_extension(const gnutls_datum_t *msg, unsigned extnr, void *priv, ext_parse_func cb) @@ -164,3 +169,7 @@ static unsigned find_server_extension(const gnutls_datum_t *msg, unsigned extnr, return 0; } + +#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# pragma GCC diagnostic pop +#endif |