From: Benjamin Kramer Date: Sat, 16 Jul 2011 20:13:06 +0000 (+0000) Subject: Zero this struct in a way that neither depends on the size of the struct nor triggers... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12efd57ee474c06880a7434ece21a39ac3f34e24;p=clang Zero this struct in a way that neither depends on the size of the struct nor triggers warnings from GCC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135351 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 74188067d3..7a14855e69 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -724,6 +724,7 @@ AnalysisBasedWarnings::IssueWarnings(sema::AnalysisBasedWarnings::Policy P, if (CFG *cfg = AC.getCFG()) { UninitValsDiagReporter reporter(S); UninitVariablesAnalysisStats stats; + std::memset(&stats, 0, sizeof(UninitVariablesAnalysisStats)); runUninitializedVariablesAnalysis(*cast(D), *cfg, AC, reporter, stats);