From 296e245b0e4355aed1e561de33189f6a103b7f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 2 May 2025 00:25:17 +0200 Subject: [PATCH] Fix compilation error with GCC 15 ``` quickjs.c:11727:32: error: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (37 chars into 36 available) [-Werror=unterminated-string-initialization] 11727 | static char const digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- .github/workflows/ci.yml | 1 + quickjs.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0278b427..119fc8e89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -330,6 +330,7 @@ jobs: - name: Setup MSYS2 uses: msys2/setup-msys2@v2 with: + update: true msystem: ${{matrix.sys}} install: >- git diff --git a/quickjs.c b/quickjs.c index 115811e8a..b6277b562 100644 --- a/quickjs.c +++ b/quickjs.c @@ -11724,7 +11724,12 @@ static JSBigInt *js_bigint_from_string(JSContext *ctx, } /* 2 <= base <= 36 */ -static char const digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz"; +static char const digits[36] = { + '0','1','2','3','4','5','6','7','8','9', + 'a','b','c','d','e','f','g','h','i','j', + 'k','l','m','n','o','p','q','r','s','t', + 'u','v','w','x','y','z' +}; /* special version going backwards */ /* XXX: use dtoa.c */