]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Fix clang -Wstring-plus-int on rtld.c
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 17 Oct 2025 19:12:48 +0000 (16:12 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 21 Oct 2025 12:24:13 +0000 (09:24 -0300)
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 warning suppression).

Reviewed-by: Sam James <sam@gentoo.org>
elf/rtld.c

index 753ce6690ba5f0bfaa87308ae342ac6703d9abed..8b472e9c0c608e8b5f47989bb2bbfcda8007c8ec 100644 (file)
@@ -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\