[COMMITTED] gnulib: Fix tst-gcc.c build with clang-23

Adhemerval Zanella <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <[email protected]>
clang-23 changed its uninitialized-use analysis to consider the operand
used.
---
 gnulib/tst-gcc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnulib/tst-gcc.c b/gnulib/tst-gcc.c
index aad8a4f12ce..c1378972d88 100644
--- a/gnulib/tst-gcc.c
+++ b/gnulib/tst-gcc.c
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
+#include <libc-diag.h>
 
 #define __no_type_class		-1
 #define __void_type_class	 0
@@ -61,12 +62,17 @@ do_test (void)
   struct { int a; } __record_type;
   union { int a; int b; } __union_type;
 
+  /* clang warns that the variables are uninitializedd, but the builtin
+     only inspects the type of its operand and never evaluates it.  */
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (23, "-Wuninitialized");
   result |= TEST (integer);
   result |= TEST (pointer);
   result |= TEST (real);
   result |= TEST (complex);
   result |= TEST (record);
   result |= TEST (union);
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
   return result;
 }
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.