From b3bb93d1d90c8d83a580293c728848a833c463fa Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 20 Feb 2024 14:12:12 -0800 Subject: [PATCH] Fix MODE=opt build --- test/libc/str/blake2_test.c | 4 ++-- third_party/python/Modules/_decimal/libmpdec/io.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/libc/str/blake2_test.c b/test/libc/str/blake2_test.c index 43ee42aa8..0b31b16a1 100644 --- a/test/libc/str/blake2_test.c +++ b/test/libc/str/blake2_test.c @@ -16,10 +16,10 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/str/blake2.h" #include "libc/assert.h" #include "libc/mem/mem.h" #include "libc/stdio/rand.h" -#include "libc/str/blake2.h" #include "libc/str/str.h" #include "libc/str/tab.internal.h" #include "libc/testlib/ezbench.h" @@ -40,7 +40,7 @@ uint8_t *HEXBLAKE2B256(const char *s) { n = strlen(s); assert(!(n & 1)); n /= 2; - p = malloc(n); + p = malloc(n + 1); for (i = 0; i < n; ++i) { a = kHexToInt[s[i * 2 + 0] & 255]; b = kHexToInt[s[i * 2 + 1] & 255]; diff --git a/third_party/python/Modules/_decimal/libmpdec/io.c b/third_party/python/Modules/_decimal/libmpdec/io.c index 00a7af879..687417335 100644 --- a/third_party/python/Modules/_decimal/libmpdec/io.c +++ b/third_party/python/Modules/_decimal/libmpdec/io.c @@ -41,6 +41,10 @@ __static_yoink("libmpdec_notice"); #pragma GCC diagnostic ignored "-Wmisleading-indentation" #endif +#if __GNUC__ >= 12 +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif + /* This file contains functions for decimal <-> string conversions, including PEP-3101 formatting for numeric types. */