[PATCH 3/3] libctf: tests: fix clang 21 uninitialized variable warning

Nick Alcock nick.alcock@oracle.com
Sun Oct 19 16:21:23 GMT 2025


The warning is spurious (the variable is unused in this situation),
but clang cannot know that.

libctf/ChangeLog:

	* testsuite/libctf-writable/symtypetab-nonlinker-writeout.c:
          Initialize dummy variable.
---
 .../testsuite/libctf-writable/symtypetab-nonlinker-writeout.c   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c b/libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
index 7a2b88d6dfa..db11c36cb95 100644
--- a/libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
+++ b/libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
@@ -25,7 +25,7 @@ try_maybe_reporting (int report)
   ctf_dict_t *fp;
   ctf_id_t func, func2, func3, base, base2, base3;
   ctf_encoding_t e = { CTF_INT_SIGNED, 0, sizeof (long) };
-  ctf_id_t dummy;
+  ctf_id_t dummy = 0;
   ctf_funcinfo_t fi;
   ctf_next_t *i = NULL;
   ctf_id_t symtype;
-- 
2.51.0.284.g117bcb8de7



More information about the Binutils mailing list