From 5a4ac999af36e80bfa75593270d50de1feb6930a Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Thu, 31 Jul 2025 12:24:27 -0700 Subject: [PATCH] Suppress -Wuninitialized-const-pointer warning Recent clang (as of #148337) introduced a warning on passing unitialized pointers to functions that take const pointers. This is entirely spurious on this code, but this works around it to keep the bots happy. Build failure: https://lab.llvm.org/buildbot/#/builders/168/builds/14779 --- llvm/unittests/Frontend/HLSLBindingTest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/unittests/Frontend/HLSLBindingTest.cpp b/llvm/unittests/Frontend/HLSLBindingTest.cpp index bd6a0ff724cf4..ca2f7b55dd613 100644 --- a/llvm/unittests/Frontend/HLSLBindingTest.cpp +++ b/llvm/unittests/Frontend/HLSLBindingTest.cpp @@ -155,8 +155,10 @@ TEST(HLSLBindingTest, TestExactOverlap) { // Since the bindings overlap exactly we need sigil values to differentiate // them. - char ID1; - char ID2; + // Note: We initialize these to 0 to suppress a -Wuninitialized-const-pointer, + // but we really are just using the stack addresses here. + char ID1 = 0; + char ID2 = 0; // StructuredBuffer A : register(t5); // StructuredBuffer B : register(t5);