[PATCH 13/59] elf: Fix clang -Wstring-plus-int on rtld.c

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Oct 17 19:12:48 GMT 2025


clang issues an warning adding 'const unsigned char' to a string
does not append to the string.

Use array indexes instead of string addition (it is simpler than
add a supress warning).
---
 elf/rtld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/rtld.c b/elf/rtld.c
index 753ce6690b..8b472e9c0c 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2494,7 +2494,7 @@ Valid options for the LD_DEBUG environment variable are:\n\n");
 
       for (cnt = 0; cnt < ndebopts; ++cnt)
 	_dl_printf ("  %.*s%s%s\n", debopts[cnt].len, debopts[cnt].name,
-		    "         " + debopts[cnt].len - 3,
+		    &"         "[debopts[cnt].len - 3],
 		    debopts[cnt].helptext);
 
       _dl_printf ("\n\
-- 
2.43.0



More information about the Libc-alpha mailing list