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

clang-23 changed its uninitialized-use analysis to consider the operand
used.
This commit is contained in:
Adhemerval Zanella
2026-08-12 15:08:02 -03:00
parent 3cd88a6952
commit b4d9c2d67c
+6
View File
@@ -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;
}