From: Ted Kremenek Date: Thu, 5 Nov 2009 08:30:12 +0000 (+0000) Subject: Tweak wording and classifications of analyzer diagnostics. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae78447ef124fcbc6bef14f73a67586420c0196a;p=clang Tweak wording and classifications of analyzer diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86127 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/BugType.h b/include/clang/Analysis/PathSensitive/BugType.h index 46b3edd317..242b8e9afe 100644 --- a/include/clang/Analysis/PathSensitive/BugType.h +++ b/include/clang/Analysis/PathSensitive/BugType.h @@ -64,10 +64,10 @@ protected: const std::string desc; public: BuiltinBug(GRExprEngine *eng, const char* n, const char* d) - : BugType(n, "Logic errors"), Eng(*eng), desc(d) {} + : BugType(n, "Logic error"), Eng(*eng), desc(d) {} BuiltinBug(GRExprEngine *eng, const char* n) - : BugType(n, "Logic errors"), Eng(*eng), desc(n) {} + : BugType(n, "Logic error"), Eng(*eng), desc(n) {} const std::string &getDescription() const { return desc; } diff --git a/lib/Analysis/VLASizeChecker.cpp b/lib/Analysis/VLASizeChecker.cpp index 76e4477449..0e731902f4 100644 --- a/lib/Analysis/VLASizeChecker.cpp +++ b/lib/Analysis/VLASizeChecker.cpp @@ -38,8 +38,8 @@ ExplodedNode *UndefSizedVLAChecker::CheckType(QualType T, ExplodedNode *Pred, if (ExplodedNode* N = Builder.generateNode(S, state, Pred)) { N->markAsSink(); if (!BT) - BT = new BugType("Declare variable-length array (VLA) of undefined " - "size", "Logic error"); + BT = new BugType("Declared variable-length array (VLA) uses a garbage" + " value as its size", "Logic error"); EnhancedBugReport *R = new EnhancedBugReport(*BT, BT->getName().c_str(), N); @@ -81,7 +81,7 @@ ExplodedNode *ZeroSizedVLAChecker::CheckType(QualType T, ExplodedNode *Pred, if (ExplodedNode* N = Builder.generateNode(S, zeroState, Pred)) { N->markAsSink(); if (!BT) - BT = new BugType("Declare variable-length array (VLA) of zero size", + BT = new BugType("Declared variable-length array (VLA) has zero size", "Logic error"); EnhancedBugReport *R = diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m index 947b41ae79..80e20c1ebb 100644 --- a/test/Analysis/misc-ps.m +++ b/test/Analysis/misc-ps.m @@ -121,12 +121,12 @@ void check_zero_sized_VLA(int x) { if (x) return; - int vla[x]; // expected-warning{{Declare variable-length array (VLA) of zero size}} + int vla[x]; // expected-warning{{Declared variable-length array (VLA) has zero size}} } void check_uninit_sized_VLA() { int x; - int vla[x]; // expected-warning{{Declare variable-length array (VLA) of undefined size}} + int vla[x]; // expected-warning{{Declared variable-length array (VLA) uses a garbage value as its size}} } // sizeof(void)