From ee10b8470ada9988c560275cbe569fdd86befd50 Mon Sep 17 00:00:00 2001 From: Matthias Schulz Date: Thu, 9 Nov 2023 15:19:28 +0100 Subject: [PATCH 1/5] Fix compiler error on gcc 4.5.2. Signed-off-by: Matthias Schulz --- library/constant_time_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/constant_time_impl.h b/library/constant_time_impl.h index f0b2fc02f..74d2732e7 100644 --- a/library/constant_time_impl.h +++ b/library/constant_time_impl.h @@ -31,7 +31,7 @@ * Disable -Wredundant-decls so that gcc does not warn about this. This is re-enabled * at the bottom of this file. */ -#ifdef __GNUC__ +#ifdef __GNUC__ > 4 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #endif From 5ffc42442da437008a4c3ae4540a57893e59b1a5 Mon Sep 17 00:00:00 2001 From: Matthias Schulz Date: Thu, 9 Nov 2023 15:44:24 +0100 Subject: [PATCH 2/5] Fix preprocessor syntax error. Signed-off-by: Matthias Schulz --- library/constant_time_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/constant_time_impl.h b/library/constant_time_impl.h index 74d2732e7..793ded4b9 100644 --- a/library/constant_time_impl.h +++ b/library/constant_time_impl.h @@ -31,7 +31,7 @@ * Disable -Wredundant-decls so that gcc does not warn about this. This is re-enabled * at the bottom of this file. */ -#ifdef __GNUC__ > 4 +#if __GNUC__ > 4 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #endif From be1e9c595142f9826218706f52181e278dace6c6 Mon Sep 17 00:00:00 2001 From: Matthias Schulz Date: Mon, 13 Nov 2023 09:33:33 +0100 Subject: [PATCH 3/5] Pop only when pushed. Signed-off-by: Matthias Schulz --- library/constant_time_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/constant_time_impl.h b/library/constant_time_impl.h index 793ded4b9..273d2153b 100644 --- a/library/constant_time_impl.h +++ b/library/constant_time_impl.h @@ -546,7 +546,7 @@ static inline mbedtls_ct_condition_t mbedtls_ct_bool_not(mbedtls_ct_condition_t return (mbedtls_ct_condition_t) (~x); } -#ifdef __GNUC__ +#if __GNUC__ > 4 /* Restore warnings for -Wredundant-decls on gcc */ #pragma GCC diagnostic pop #endif From 3f80ffb9ff89439cbed08169ed174476247fe110 Mon Sep 17 00:00:00 2001 From: Matthias Schulz <140500342+mschulz-at-hilscher@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:35:45 +0100 Subject: [PATCH 4/5] Update library/constant_time_impl.h Co-authored-by: Dave Rodgman Signed-off-by: Matthias Schulz <140500342+mschulz-at-hilscher@users.noreply.github.com> --- library/constant_time_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/constant_time_impl.h b/library/constant_time_impl.h index 273d2153b..821e7cffa 100644 --- a/library/constant_time_impl.h +++ b/library/constant_time_impl.h @@ -31,7 +31,7 @@ * Disable -Wredundant-decls so that gcc does not warn about this. This is re-enabled * at the bottom of this file. */ -#if __GNUC__ > 4 +#if defined(MBEDTLS_COMPILER_IS_GCC) && (__GNUC__ > 4) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #endif From 90c8c3235b588dfe711916bc77cfd03440e71f5e Mon Sep 17 00:00:00 2001 From: Matthias Schulz <140500342+mschulz-at-hilscher@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:35:50 +0100 Subject: [PATCH 5/5] Update library/constant_time_impl.h Co-authored-by: Dave Rodgman Signed-off-by: Matthias Schulz <140500342+mschulz-at-hilscher@users.noreply.github.com> --- library/constant_time_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/constant_time_impl.h b/library/constant_time_impl.h index 821e7cffa..08b2f6df1 100644 --- a/library/constant_time_impl.h +++ b/library/constant_time_impl.h @@ -546,7 +546,7 @@ static inline mbedtls_ct_condition_t mbedtls_ct_bool_not(mbedtls_ct_condition_t return (mbedtls_ct_condition_t) (~x); } -#if __GNUC__ > 4 +#if defined(MBEDTLS_COMPILER_IS_GCC) && (__GNUC__ > 4) /* Restore warnings for -Wredundant-decls on gcc */ #pragma GCC diagnostic pop #endif