Skip to content

Commit 506834d

Browse files
authored
Suppress -Wuninitialized-const-pointer warning (#151583)
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
1 parent e46d938 commit 506834d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/unittests/Frontend/HLSLBindingTest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ TEST(HLSLBindingTest, TestExactOverlap) {
155155

156156
// Since the bindings overlap exactly we need sigil values to differentiate
157157
// them.
158-
char ID1;
159-
char ID2;
158+
// Note: We initialize these to 0 to suppress a -Wuninitialized-const-pointer,
159+
// but we really are just using the stack addresses here.
160+
char ID1 = 0;
161+
char ID2 = 0;
160162

161163
// StructuredBuffer<float> A : register(t5);
162164
// StructuredBuffer<float> B : register(t5);

0 commit comments

Comments
 (0)