[cfe-commits] r124352 - /cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
Ted Kremenek
kremenek at apple.com
Wed Jan 26 18:57:57 PST 2011
Author: kremenek
Date: Wed Jan 26 20:57:57 2011
New Revision: 124352
URL: http://llvm.org/viewvc/llvm-project?rev=124352&view=rev
Log:
Teach -Wuninitialized to suggest "= false" for initializing bool variables.
Modified:
cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=124352&r1=124351&r2=124352&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Wed Jan 26 20:57:57 2011
@@ -433,6 +433,9 @@
else if (vdTy->isRealFloatingType()) {
initialization = " = 0.0";
}
+ else if (vdTy->isBooleanType()) {
+ initialization = " = false";
+ }
else if (vdTy->isScalarType()) {
initialization = " = 0";
}
More information about the cfe-commits
mailing list