From d5a7b5633274818c95ac7a2d17e1fa15e3cebc26 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 4 Jan 2023 16:19:27 -0800 Subject: [PATCH] sp pragram around sanity check for vcpkg build warning --- wolfcrypt/src/sp_int.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index b5199ed73..cbff871f0 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -4822,6 +4822,10 @@ int sp_copy(const sp_int* a, sp_int* r) } /* Only copy if different pointers. */ else if (a != r) { + PRAGMA_GCC_DIAG_PUSH + PRAGMA_GCC("GCC diagnostic ignored \"-Wstrict-overflow\"") + /* Surrounded in gcc pragma to avoid -Werror=strict-overflow when the + * compiler optimizes out the check and assumes no overflow. */ /* Validated space in result. */ if (a->used > r->size) { err = MP_VAL; @@ -4841,6 +4845,7 @@ int sp_copy(const sp_int* a, sp_int* r) r->sign = a->sign; #endif } + PRAGMA_GCC_DIAG_POP } return err;