From 638b4816135c3b3426fed2e1b8834acec3fc831c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Mon, 25 May 2026 10:27:15 +0200 Subject: [PATCH] tools/nolibc: cast default values of program_invocation_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With -Wwrite-strings the plain assignment triggers a warning as a 'const char *' is assigned to a 'char *', removing the const qualifier. Casting the const away is fine, as there is no valid modification that can be done to an empty string anyways. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Link: https://patch.msgid.link/20260525-nolibc-write-strings-v2-1-ab5cc16c7b23@weissschuh.net --- tools/include/nolibc/errno.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/include/nolibc/errno.h b/tools/include/nolibc/errno.h index bab83692ea1c..a2325596d550 100644 --- a/tools/include/nolibc/errno.h +++ b/tools/include/nolibc/errno.h @@ -15,8 +15,8 @@ #ifndef NOLIBC_IGNORE_ERRNO #define SET_ERRNO(v) do { errno = (v); } while (0) int errno __attribute__((weak)); -char *program_invocation_name __attribute__((weak)) = ""; -char *program_invocation_short_name __attribute__((weak)) = ""; +char *program_invocation_name __attribute__((weak)) = (char *)""; +char *program_invocation_short_name __attribute__((weak)) = (char *)""; #else #define SET_ERRNO(v) do { } while (0) #define program_invocation_name ""