From: Richard Henderson Date: Fri, 5 Jul 2024 08:40:13 +0000 (+0100) Subject: tests/tcg/minilib: Constify digits in print_num X-Git-Tag: qemu-xen-4.20.0~85^2~34 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7e3798eddde9bcbf3e83ddcd236eeca4c413f34f;p=qemu-xen.git tests/tcg/minilib: Constify digits in print_num This avoids a memcpy to the stack when compiled with clang. Since we don't enable optimization, nor provide memcpy, this results in an undefined symbol error at link time. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki Message-Id: <20240630190050.160642-2-richard.henderson@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240705084047.857176-7-alex.bennee@linaro.org> --- diff --git a/tests/tcg/minilib/printf.c b/tests/tcg/minilib/printf.c index 10472b4f58..fb0189c2bb 100644 --- a/tests/tcg/minilib/printf.c +++ b/tests/tcg/minilib/printf.c @@ -27,7 +27,7 @@ static void print_str(char *s) static void print_num(unsigned long long value, int base) { - char digits[] = "0123456789abcdef"; + static const char digits[] = "0123456789abcdef"; char buf[32]; int i = sizeof(buf) - 2, j;