From 43e5d26a5656cb0fec35bee609c669e429699d7d Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 18 Jan 2018 13:28:54 +0000 Subject: [PATCH] Fix MSVC "uninitialized variable" warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322845 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/c-index-test/c-index-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index ceb2ef6be4..d030bbff2e 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -739,7 +739,10 @@ static CXString CursorToText(CXCursor Cursor) { } } assert(0 && "unknown display type"); /* no llvm_unreachable in C. */ - return /*garbage*/ text; + // Set to NULL to prevent uninitialized variable warnings. + text.data = NULL; + text.private_flags = 0; + return text; } static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) { -- 2.40.0