Skip to content

Commit e219839

Browse files
committed
Luke
1 parent b87bc7b commit e219839

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

patch/0016-Avoid-mbedtls-diagnostic-pragmas.patch

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,52 @@ diff --git a/src/duckdb/third_party/mbedtls/library/constant_time_impl.h b/src/d
1212
index f63176c16..8d8aa87f0 100644
1313
--- a/src/duckdb/third_party/mbedtls/library/constant_time_impl.h
1414
+++ b/src/duckdb/third_party/mbedtls/library/constant_time_impl.h
15-
@@ -32,8 +32,6 @@
15+
@@ -32,8 +32,8 @@
1616
* at the bottom of this file.
1717
*/
1818
#if defined(MBEDTLS_COMPILER_IS_GCC) && (__GNUC__ > 4)
1919
- #pragma GCC diagnostic push
2020
- #pragma GCC diagnostic ignored "-Wredundant-decls"
21+
+ #pragma GCC diagnostic push
22+
+ #pragma GCC diagnostic ignored "-Wredundant-decls"
2123
#endif
2224

2325
/* Disable asm under Memsan because it confuses Memsan and generates false errors.
24-
@@ -549,8 +547,6 @@ inline mbedtls_ct_condition_t mbedtls_ct_bool_not(mbedtls_ct_condition_t x)
26+
@@ -549,8 +547,8 @@ inline mbedtls_ct_condition_t mbedtls_ct_bool_not(mbedtls_ct_condition_t x)
2527
}
2628

2729
#if defined(MBEDTLS_COMPILER_IS_GCC) && (__GNUC__ > 4)
28-
-/* Restore warnings for -Wredundant-decls on gcc */
30+
/* Restore warnings for -Wredundant-decls on gcc */
2931
- #pragma GCC diagnostic pop
32+
+ #pragma GCC diagnostic pop
3033
#endif
3134

3235
#endif /* MBEDTLS_CONSTANT_TIME_IMPL_H */
3336
diff --git a/src/duckdb/third_party/mbedtls/library/platform_util.cpp b/src/duckdb/third_party/mbedtls/library/platform_util.cpp
3437
index 19ef07aea..889caab08 100644
3538
--- a/src/duckdb/third_party/mbedtls/library/platform_util.cpp
3639
+++ b/src/duckdb/third_party/mbedtls/library/platform_util.cpp
37-
@@ -118,17 +118,11 @@ void mbedtls_platform_zeroize(void *buf, size_t len)
40+
@@ -118,17 +118,17 @@ void mbedtls_platform_zeroize(void *buf, size_t len)
3841
* zero'd memory as an additional protection against being optimised away. */
3942
#if defined(__clang__) || (__GNUC__ >= 10)
4043
#if defined(__clang__)
4144
-#pragma clang diagnostic push
4245
-#pragma clang diagnostic ignored "-Wvla"
46+
+#pragma clang diagnostic push
47+
+#pragma clang diagnostic ignored "-Wvla"
4348
#elif defined(MBEDTLS_COMPILER_IS_GCC)
4449
-#pragma GCC diagnostic push
4550
-#pragma GCC diagnostic ignored "-Wvla"
51+
+#pragma GCC diagnostic push
52+
+#pragma GCC diagnostic ignored "-Wvla"
4653
#endif
4754
asm volatile ("" : : "m" (*(char (*)[len]) buf) :);
4855
#if defined(__clang__)
4956
-#pragma clang diagnostic pop
57+
+#pragma clang diagnostic pop
5058
#elif defined(MBEDTLS_COMPILER_IS_GCC)
5159
-#pragma GCC diagnostic pop
60+
+#pragma GCC diagnostic pop
5261
#endif
5362
#endif
5463
#endif

src/duckdb/third_party/mbedtls/library/constant_time_impl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
* at the bottom of this file.
3333
*/
3434
#if defined(MBEDTLS_COMPILER_IS_GCC) && (__GNUC__ > 4)
35+
#pragma GCC diagnostic push
36+
#pragma GCC diagnostic ignored "-Wredundant-decls"
3537
#endif
3638

3739
/* Disable asm under Memsan because it confuses Memsan and generates false errors.
@@ -547,6 +549,8 @@ inline mbedtls_ct_condition_t mbedtls_ct_bool_not(mbedtls_ct_condition_t x)
547549
}
548550

549551
#if defined(MBEDTLS_COMPILER_IS_GCC) && (__GNUC__ > 4)
552+
/* Restore warnings for -Wredundant-decls on gcc */
553+
#pragma GCC diagnostic pop
550554
#endif
551555

552556
#endif /* MBEDTLS_CONSTANT_TIME_IMPL_H */

src/duckdb/third_party/mbedtls/library/platform_util.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,17 @@ void mbedtls_platform_zeroize(void *buf, size_t len)
118118
* zero'd memory as an additional protection against being optimised away. */
119119
#if defined(__clang__) || (__GNUC__ >= 10)
120120
#if defined(__clang__)
121+
#pragma clang diagnostic push
122+
#pragma clang diagnostic ignored "-Wvla"
121123
#elif defined(MBEDTLS_COMPILER_IS_GCC)
124+
#pragma GCC diagnostic push
125+
#pragma GCC diagnostic ignored "-Wvla"
122126
#endif
123127
asm volatile ("" : : "m" (*(char (*)[len]) buf) :);
124128
#if defined(__clang__)
129+
#pragma clang diagnostic pop
125130
#elif defined(MBEDTLS_COMPILER_IS_GCC)
131+
#pragma GCC diagnostic pop
126132
#endif
127133
#endif
128134
#endif

0 commit comments

Comments
 (0)