diff --git a/library/gcm.c b/library/gcm.c index 976d6d76de..5dfac2349c 100644 --- a/library/gcm.c +++ b/library/gcm.c @@ -412,14 +412,14 @@ int mbedtls_gcm_starts(mbedtls_gcm_context *ctx, while (iv_len > 0) { use_len = (iv_len < 16) ? iv_len : 16; -#if defined(MBEDTLS_COMPILER_IS_GCC) +#if defined(MBEDTLS_COMPILER_IS_GCC) && (MBEDTLS_GCC_VERSION >= 70110) #pragma GCC diagnostic push #pragma GCC diagnostic warning "-Wstringop-overflow=0" #endif mbedtls_xor(ctx->y, ctx->y, p, use_len); -#if defined(MBEDTLS_COMPILER_IS_GCC) +#if defined(MBEDTLS_COMPILER_IS_GCC) && (MBEDTLS_GCC_VERSION >= 70110) #pragma GCC diagnostic pop #endif