From 84123f5a95ad17b8b3b2df0f2071d3b82d02ce81 Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Sat, 4 Nov 2023 19:23:31 -0700 Subject: [PATCH] Disable -Wstringop-overflow in sds.c Spurious warning with GCC 11 on Red Hat UBI 9.2 --- src/hiredis/sds.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hiredis/sds.c b/src/hiredis/sds.c index 49d2096b..245787c8 100644 --- a/src/hiredis/sds.c +++ b/src/hiredis/sds.c @@ -30,6 +30,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + #include "fmacros.h" #include #include @@ -1287,3 +1292,7 @@ int main(void) { return sdsTest(); } #endif + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif