From: Simon Pilgrim Date: Thu, 18 Jan 2018 13:28:54 +0000 (+0000) Subject: Fix MSVC "uninitialized variable" warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43e5d26a5656cb0fec35bee609c669e429699d7d;p=clang Fix MSVC "uninitialized variable" warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322845 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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) {