Fix MODE=opt build

This commit is contained in:
Justine Tunney 2024-02-20 14:12:12 -08:00
parent 980af27bbf
commit b3bb93d1d9
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 6 additions and 2 deletions

View file

@ -16,10 +16,10 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
*/ */
#include "libc/str/blake2.h"
#include "libc/assert.h" #include "libc/assert.h"
#include "libc/mem/mem.h" #include "libc/mem/mem.h"
#include "libc/stdio/rand.h" #include "libc/stdio/rand.h"
#include "libc/str/blake2.h"
#include "libc/str/str.h" #include "libc/str/str.h"
#include "libc/str/tab.internal.h" #include "libc/str/tab.internal.h"
#include "libc/testlib/ezbench.h" #include "libc/testlib/ezbench.h"
@ -40,7 +40,7 @@ uint8_t *HEXBLAKE2B256(const char *s) {
n = strlen(s); n = strlen(s);
assert(!(n & 1)); assert(!(n & 1));
n /= 2; n /= 2;
p = malloc(n); p = malloc(n + 1);
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
a = kHexToInt[s[i * 2 + 0] & 255]; a = kHexToInt[s[i * 2 + 0] & 255];
b = kHexToInt[s[i * 2 + 1] & 255]; b = kHexToInt[s[i * 2 + 1] & 255];

View file

@ -41,6 +41,10 @@ __static_yoink("libmpdec_notice");
#pragma GCC diagnostic ignored "-Wmisleading-indentation" #pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif #endif
#if __GNUC__ >= 12
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
/* This file contains functions for decimal <-> string conversions, including /* This file contains functions for decimal <-> string conversions, including
PEP-3101 formatting for numeric types. */ PEP-3101 formatting for numeric types. */