[glibc/azanella/clang] elf: Suppress clang -Wstring-plus-int on rtld.c

Adhemerval Zanella azanella@sourceware.org
Tue Apr 2 15:52:00 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=578a95995614f53e141f93f9b61cbb074fa926fa

commit 578a95995614f53e141f93f9b61cbb074fa926fa
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 09:48:32 2022 -0300

    elf: Suppress clang -Wstring-plus-int on rtld.c
    
    clang issues an warning adding 'const unsigned char' to a string
    does not append to the string, however it is exactly what code
    means here.

Diff:
---
 elf/rtld.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/elf/rtld.c b/elf/rtld.c
index 18d73f19c6..ba1edcbc6f 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2522,10 +2522,16 @@ warning: debug option `%s' unknown; try LD_DEBUG=help\n", copy);
       _dl_printf ("\
 Valid options for the LD_DEBUG environment variable are:\n\n");
 
+      /* clang issues an warning adding 'const unsigned char' to a string
+	 does not append to the string, however it is exactly what code
+	 means here.  */
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (16, "-Wstring-plus-int");
       for (cnt = 0; cnt < ndebopts; ++cnt)
 	_dl_printf ("  %.*s%s%s\n", debopts[cnt].len, debopts[cnt].name,
 		    "         " + debopts[cnt].len - 3,
 		    debopts[cnt].helptext);
+      DIAG_POP_NEEDS_COMMENT_CLANG;
 
       _dl_printf ("\n\
 To direct the debugging output into a file instead of standard output\n\


More information about the Glibc-cvs mailing list