[clang] [analyzer] Remove double spaces after sentence endings in emitted diagnostics (PR #228777)
Benedek Kaibas via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 26 09:08:10 PDT 2026
https://github.com/benedekaibas updated https://github.com/llvm/llvm-project/pull/228777
>From c7121f0eb13a1d5350a0a00c62688c79fd5740e1 Mon Sep 17 00:00:00 2001
From: benedekaibas <kaibas01 at allegheny.edu>
Date: Sat, 3 Oct 2026 23:27:55 +0200
Subject: [PATCH 1/5] [analyzer] Fix double space in
generateMinimalDiagForBlockEdge emitted notes
---
clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 4 ++--
clang/test/Analysis/dangling-ptr-deref.cpp | 2 +-
.../diagnostics/track_subexpressions.cpp | 4 ++--
clang/test/Analysis/loop-widening-notes.cpp | 8 +++----
clang/test/Analysis/loop-widening.cpp | 4 ++--
clang/test/Analysis/return-ptr-range.cpp | 4 ++--
.../track-control-dependency-conditions.cpp | 6 ++---
clang/test/Analysis/use-after-move.cpp | 24 +++++++++----------
8 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index 25d10df604bda1..595f6b0090b41d 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -972,7 +972,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge(
C.getActivePath().push_front(
std::make_shared<PathDiagnosticControlFlowPiece>(
- Start, End, "Loop condition is false. Exiting loop"));
+ Start, End, "Loop condition is false. Exiting loop"));
}
break;
@@ -996,7 +996,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge(
C.getActivePath().push_front(
std::make_shared<PathDiagnosticControlFlowPiece>(
- Start, End, "Loop condition is true. Entering loop body"));
+ Start, End, "Loop condition is true. Entering loop body"));
}
break;
diff --git a/clang/test/Analysis/dangling-ptr-deref.cpp b/clang/test/Analysis/dangling-ptr-deref.cpp
index 8572b6416f150f..1c026b5528921b 100644
--- a/clang/test/Analysis/dangling-ptr-deref.cpp
+++ b/clang/test/Analysis/dangling-ptr-deref.cpp
@@ -72,7 +72,7 @@ void test_case_six() {
void test_case_seven() {
int *ptr = nullptr;
- // expected-note at +3 {{Loop condition is true. Entering loop body}}
+ // expected-note at +3 {{Loop condition is true. Entering loop body}}
// expected-note at +2 {{Assuming 'i' is >= 10}}
// expected-note at +1 {{Loop condition is false. Execution continues on line}}
for (int i = 0; i < 10; ++i) { // expected-note {{'i' initialized to 0}}
diff --git a/clang/test/Analysis/diagnostics/track_subexpressions.cpp b/clang/test/Analysis/diagnostics/track_subexpressions.cpp
index c61738ce7b136d..76cf9e3e242850 100644
--- a/clang/test/Analysis/diagnostics/track_subexpressions.cpp
+++ b/clang/test/Analysis/diagnostics/track_subexpressions.cpp
@@ -37,7 +37,7 @@ void testArrayIndexTracking() {
int arr[10];
for (int i = 0; i < 3; ++i)
- // expected-note at -1 3{{Loop condition is true. Entering loop body}}
+ // expected-note at -1 3{{Loop condition is true. Entering loop body}}
// expected-note at -2 {{Loop condition is false. Execution continues on line 43}}
arr[i] = 0;
int x = getInt();
@@ -69,7 +69,7 @@ void testArrayIndexTracking() {
int arr[2][10];
for (int i = 0; i < 3; ++i)
- // expected-note at -1 3{{Loop condition is true. Entering loop body}}
+ // expected-note at -1 3{{Loop condition is true. Entering loop body}}
// expected-note at -2 {{Loop condition is false. Execution continues on line 75}}
arr[1][i] = 0;
int x = getInt();
diff --git a/clang/test/Analysis/loop-widening-notes.cpp b/clang/test/Analysis/loop-widening-notes.cpp
index a3f030dfe98826..7bd61fe0db4d0f 100644
--- a/clang/test/Analysis/loop-widening-notes.cpp
+++ b/clang/test/Analysis/loop-widening-notes.cpp
@@ -7,7 +7,7 @@ int test_for_bug_25609() {
if (p_a == 0) // expected-note {{Assuming 'p_a' is equal to null}}
// expected-note at -1 {{Taking true branch}}
bar();
- for (int i = 0; // expected-note {{Loop condition is true. Entering loop body}}
+ for (int i = 0; // expected-note {{Loop condition is true. Entering loop body}}
// expected-note at -1 {{Loop condition is false. Execution continues on line 16}}
++i, // expected-note {{Value assigned to 'p_a'}}
i < flag_a;
@@ -22,7 +22,7 @@ int flag_b;
int while_analyzer_output() {
flag_b = 100;
int num = 10;
- while (flag_b-- > 0) { // expected-note {{Loop condition is true. Entering loop body}}
+ while (flag_b-- > 0) { // expected-note {{Loop condition is true. Entering loop body}}
// expected-note at -1 {{Value assigned to 'num'}}
// expected-note at -2 {{Loop condition is false. Execution continues on line 30}}
num = flag_b;
@@ -43,7 +43,7 @@ int flag_c;
int do_while_analyzer_output() {
int num = 10;
do { // expected-note {{Loop condition is true. Execution continues on line 47}}
- // expected-note at -1 {{Loop condition is false. Exiting loop}}
+ // expected-note at -1 {{Loop condition is false. Exiting loop}}
num--;
} while (flag_c-- > 0); //expected-note {{Value assigned to 'num'}}
int local = 0;
@@ -57,7 +57,7 @@ int do_while_analyzer_output() {
int flag_d;
int test_for_loop() {
int num = 10;
- for (int i = 0; // expected-note {{Loop condition is true. Entering loop body}}
+ for (int i = 0; // expected-note {{Loop condition is true. Entering loop body}}
// expected-note at -1 {{Loop condition is false. Execution continues on line 67}}
new int(10), // expected-note {{Value assigned to 'num'}}
i < flag_d;
diff --git a/clang/test/Analysis/loop-widening.cpp b/clang/test/Analysis/loop-widening.cpp
index fbcb72dee160ae..fa8e9c2f3d6968 100644
--- a/clang/test/Analysis/loop-widening.cpp
+++ b/clang/test/Analysis/loop-widening.cpp
@@ -14,8 +14,8 @@ void fn1() {
A a;
A *b = &a;
- for (;;) { // expected-note{{Loop condition is true. Entering loop body}}
- // expected-note at -1{{Loop condition is true. Entering loop body}}
+ for (;;) { // expected-note{{Loop condition is true. Entering loop body}}
+ // expected-note at -1{{Loop condition is true. Entering loop body}}
// expected-note at -2{{Value assigned to 'b'}}
// no crash during bug report construction
diff --git a/clang/test/Analysis/return-ptr-range.cpp b/clang/test/Analysis/return-ptr-range.cpp
index 507720a47ea7d5..53612174897c75 100644
--- a/clang/test/Analysis/return-ptr-range.cpp
+++ b/clang/test/Analysis/return-ptr-range.cpp
@@ -8,7 +8,7 @@ int arr[10]; // expected-note{{Original object declared here}} expected-note{{Or
int *ptr;
int *test_global_ptr() {
- do { // expected-note{{Loop condition is false. Exiting loop}}
+ do { // expected-note{{Loop condition is false. Exiting loop}}
int x = conjure_index();
ptr = arr + x; // expected-note{{Value assigned to 'ptr'}}
if (x != 20) // expected-note{{Assuming 'x' is equal to 20}}
@@ -22,7 +22,7 @@ int *test_global_ptr() {
int *test_local_ptr() {
int *local_ptr;
- do { // expected-note{{Loop condition is false. Exiting loop}}
+ do { // expected-note{{Loop condition is false. Exiting loop}}
int x = conjure_index();
local_ptr = arr + x; // expected-note{{Value assigned to 'local_ptr'}}
if (x != 20) // expected-note{{Assuming 'x' is equal to 20}}
diff --git a/clang/test/Analysis/track-control-dependency-conditions.cpp b/clang/test/Analysis/track-control-dependency-conditions.cpp
index b762992b6a8f0b..76f9641729de5d 100644
--- a/clang/test/Analysis/track-control-dependency-conditions.cpp
+++ b/clang/test/Analysis/track-control-dependency-conditions.cpp
@@ -858,7 +858,7 @@ void f(int flag) {
bar();
assert(cond1); // expected-note-re{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
// expected-note-re at -1{{{{^}}Taking false branch{{$}}}}
- // expected-note-re at -2{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+ // expected-note-re at -2{{{{^}}Loop condition is false. Exiting loop{{$}}}}
if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
// expected-note-re at -1{{{{^}}Taking true branch{{$}}}}
@@ -902,7 +902,7 @@ void f(int flag) {
// expected-note-re at -2{{{{^}}Left side of '&&' is true{{$}}}}
// expected-note-re at -3{{{{^}}Assuming the condition is false{{$}}}}
// expected-note-re at -4{{{{^}}Taking false branch{{$}}}}
- // expected-note-re at -5{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+ // expected-note-re at -5{{{{^}}Loop condition is false. Exiting loop{{$}}}}
if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
// expected-note-re at -1{{{{^}}Taking true branch{{$}}}}
@@ -945,7 +945,7 @@ void f(int flag) {
// expected-note-re at -1{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
// expected-note-re at -2{{{{^}}Left side of '||' is true{{$}}}}
// expected-note-re at -3{{{{^}}Taking false branch{{$}}}}
- // expected-note-re at -4{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+ // expected-note-re at -4{{{{^}}Loop condition is false. Exiting loop{{$}}}}
if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
// expected-note-re at -1{{{{^}}Taking true branch{{$}}}}
diff --git a/clang/test/Analysis/use-after-move.cpp b/clang/test/Analysis/use-after-move.cpp
index fa7893c9a21c8b..a123c41c651e60 100644
--- a/clang/test/Analysis/use-after-move.cpp
+++ b/clang/test/Analysis/use-after-move.cpp
@@ -303,8 +303,8 @@ void loopTest() {
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
// peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
rightRefCall(std::move(a)); // no-warning
}
@@ -317,8 +317,8 @@ void loopTest() {
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
// peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
leftRefCall(a); // no-warning
}
@@ -331,8 +331,8 @@ void loopTest() {
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
// peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
constCopyOrMoveCall(a); // no-warning
}
@@ -345,8 +345,8 @@ void loopTest() {
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
// peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
moveInsideFunctionCall(a); // no-warning
}
@@ -359,16 +359,16 @@ void loopTest() {
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
// peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
copyOrMoveCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
+ for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
constCopyOrMoveCall(std::move(a)); // peaceful-note {{Object 'a' is moved}}
// peaceful-warning at -1 {{Moved-from object 'a' is moved}}
// peaceful-note at -2 {{Moved-from object 'a' is moved}}
>From efb65443dd0b1ce7cc3917bbaf2779a97bbce3f3 Mon Sep 17 00:00:00 2001
From: benedekaibas <kaibas01 at allegheny.edu>
Date: Thu, 15 Oct 2026 15:06:59 +0200
Subject: [PATCH 2/5] Convert double spaces to single after sentence endings in
the CSA.
---
clang/docs/ReleaseNotes.md | 1 +
.../Checkers/CheckObjCInstMethSignature.cpp | 4 +--
.../Checkers/CheckSecuritySyntaxOnly.cpp | 11 ++++----
.../Checkers/MacOSXAPIChecker.cpp | 4 +--
.../RetainCountDiagnostics.cpp | 4 +--
.../Checkers/StackAddrEscapeChecker.cpp | 2 +-
.../Checkers/UnixAPIChecker.cpp | 2 +-
clang/test/Analysis/const-method-call.cpp | 2 +-
.../cxx-uninitialized-object-ptr-ref.cpp | 12 ++++----
clang/test/Analysis/dispatch-once.m | 4 +--
.../test/Analysis/incorrect-checker-names.cpp | 4 +--
.../test/Analysis/retain-release-path-notes.m | 4 +--
clang/test/Analysis/security-syntax-checks.m | 28 +++++++++----------
clang/test/Analysis/stack-addr-ps.cpp | 4 +--
.../Analysis/stack-capture-leak-no-arc.mm | 4 +--
clang/test/Analysis/stackaddrleak.c | 4 +--
clang/test/Analysis/stackaddrleak.cpp | 2 +-
17 files changed, 49 insertions(+), 47 deletions(-)
diff --git a/clang/docs/ReleaseNotes.md b/clang/docs/ReleaseNotes.md
index d6c40a2920cf5a..21a7483a2d4eac 100644
--- a/clang/docs/ReleaseNotes.md
+++ b/clang/docs/ReleaseNotes.md
@@ -1053,6 +1053,7 @@ The `alpha.cplusplus.UseAfterLifetimeEnd` checker was renamed to `alpha.core.Use
#### Diagnostic changes
- For self-assignments during initialization (`T v = v;`), `core.uninitialized.Assign` will not report them as uninitialized accesses (except C++ reference types), and the checks will be delayed until the first accesses of these variables; `deadcode.DeadStores` will not report them as dead stores. (#GH187530)
+- The Clang Static Analyzer's emitted diagnostics (warnings, notes) now consistently have one space after sentence endings (#GH228777). The RFC for this change can be found here: https://discourse.llvm.org/t/rfc-standardization-of-reports-sentence-spacing/92428
(release-notes-sanitizers)=
diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
index c8fe5c2ccf384e..010c7589cfca12 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
@@ -56,11 +56,11 @@ static void CompareReturnTypes(const ObjCMethodDecl *MethDerived,
<< "', defines the instance method '";
MethDerived->getSelector().print(os);
os << "' whose return type is '" << ResDerived
- << "'. A method with the same name (same selector) is also defined in "
+ << "'. A method with the same name (same selector) is also defined in "
"class '"
<< *MethAncestor->getClassInterface() << "' and has a return type of '"
<< ResAncestor
- << "'. These two types are incompatible, and may result in undefined "
+ << "'. These two types are incompatible, and may result in undefined "
"behavior for clients of these classes.";
PathDiagnosticLocation MethDLoc =
diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
index 797e1efc7e8ca5..eeb6c99c91c6da 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
@@ -588,7 +588,7 @@ void WalkAST::checkCall_mktemp(const CallExpr *CE, const FunctionDecl *FD) {
"Potential insecure temporary file in call 'mktemp'",
"Security",
"Call to function 'mktemp' is insecure as it always "
- "creates or uses insecure temporary file. Use 'mkstemp' "
+ "creates or uses insecure temporary file. Use 'mkstemp' "
"instead",
CELoc, CE->getCallee()->getSourceRange());
}
@@ -893,7 +893,7 @@ void WalkAST::checkCall_rand(const CallExpr *CE, const FunctionDecl *FD) {
llvm::raw_svector_ostream os2(buf2);
os2 << "Function '" << *FD
<< "' is obsolete because it implements a poor random number generator."
- << " Use 'arc4random' instead";
+ << " Use 'arc4random' instead";
PathDiagnosticLocation CELoc =
PathDiagnosticLocation::createBegin(CE, BR.getSourceManager(), AC);
@@ -922,8 +922,9 @@ void WalkAST::checkCall_random(const CallExpr *CE, const FunctionDecl *FD) {
"'random' is not a secure random number generator",
"Security",
"The 'random' function produces a sequence of values that "
- "an adversary may be able to predict. Use 'arc4random' "
- "instead", CELoc, CE->getCallee()->getSourceRange());
+ "an adversary may be able to predict. Use 'arc4random' "
+ "instead",
+ CELoc, CE->getCallee()->getSourceRange());
}
//===----------------------------------------------------------------------===//
@@ -1064,7 +1065,7 @@ void WalkAST::checkUncheckedReturnValue(CallExpr *CE) {
SmallString<256> buf2;
llvm::raw_svector_ostream os2(buf2);
os2 << "The return value from the call to '" << *FD
- << "' is not checked. If an error occurs in '" << *FD
+ << "' is not checked. If an error occurs in '" << *FD
<< "', the following code may execute with unexpected privileges";
PathDiagnosticLocation CELoc =
diff --git a/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
index 6439e6cedac085..9de17198f6bc4f 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
@@ -125,10 +125,10 @@ void MacOSXAPIChecker::CheckDispatchOnce(CheckerContext &C, const CallExpr *CE,
} else {
os << " stack allocated memory";
}
- os << " for the predicate value. Using such transient memory for "
+ os << " for the predicate value. Using such transient memory for "
"the predicate is potentially dangerous.";
if (SuggestStatic)
- os << " Perhaps you intended to declare the variable as 'static'?";
+ os << " Perhaps you intended to declare the variable as 'static'?";
ExplodedNode *N = C.generateErrorNode();
if (!N)
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
index 59d11c4d8ae2cf..10a75aa5874d98 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
@@ -746,7 +746,7 @@ RefLeakReportVisitor::getEndPath(const ExplodedNode *EndN,
os << "whose name ('" << MD->getSelector().getAsString()
<< "') does not start with "
"'copy', 'mutableCopy', 'alloc' or 'new'."
- " This violates the naming convention rules"
+ " This violates the naming convention rules"
" given in the Memory Management Guide for Cocoa";
}
} else {
@@ -754,7 +754,7 @@ RefLeakReportVisitor::getEndPath(const ExplodedNode *EndN,
ObjKind K = RV->getObjKind();
if (K == ObjKind::ObjC || K == ObjKind::CF) {
os << "whose name ('" << *FD
- << "') does not contain 'Copy' or 'Create'. This violates the "
+ << "') does not contain 'Copy' or 'Create'. This violates the "
"naming convention rules given in the Memory Management Guide "
"for Core Foundation";
} else if (RV->getObjKind() == ObjKind::OS) {
diff --git a/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
index db307d3ac549f6..3ccfb7e15dda20 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
@@ -585,7 +585,7 @@ void StackAddrEscapeChecker::checkEndFunction(const ReturnStmt *RS,
// Generate a report for this bug.
const StringRef CommonSuffix =
- " upon returning to the caller. This will be a dangling reference";
+ " upon returning to the caller. This will be a dangling reference";
SmallString<128> Buf;
llvm::raw_svector_ostream Out(Buf);
const SourceRange Range = genName(Out, Referred, Ctx.getASTContext());
diff --git a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
index e51a74f7259752..0a55d1da7f91bc 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
@@ -435,7 +435,7 @@ void UnixAPIMisuseChecker::CheckPthreadOnce(CheckerContext &C,
os << " the local variable '" << VR->getDecl()->getName() << '\'';
else
os << " stack allocated memory";
- os << " for the \"control\" value. Using such transient memory for "
+ os << " for the \"control\" value. Using such transient memory for "
"the control value is potentially dangerous.";
if (isa<VarRegion>(R) && R->hasMemorySpace<StackLocalsSpaceRegion>(state))
os << " Perhaps you intended to declare the variable as 'static'?";
diff --git a/clang/test/Analysis/const-method-call.cpp b/clang/test/Analysis/const-method-call.cpp
index b37ce17447bdd2..47467043363eac 100644
--- a/clang/test/Analysis/const-method-call.cpp
+++ b/clang/test/Analysis/const-method-call.cpp
@@ -314,6 +314,6 @@ template <typename R> class callable<R()> {
void entry() {
callable<bool()>{}.call().const_method();
- // expected-warning at -1 {{Address of stack memory associated with temporary object of type 'callable<bool ()>' is still referred to by the static variable 'L' upon returning to the caller. This will be a dangling reference}}
+ // expected-warning at -1 {{Address of stack memory associated with temporary object of type 'callable<bool ()>' is still referred to by the static variable 'L' upon returning to the caller. This will be a dangling reference}}
}
} // namespace gh77378
diff --git a/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp b/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
index fddd6c8c3d6dfc..87ad5be8fb52f7 100644
--- a/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
+++ b/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
@@ -86,7 +86,7 @@ struct UntypedAllocaTest {
// expected-warning-re at +3 {{Address of stack memory allocated by call to \
alloca() on line {{[0-9]+}} is still referred to by a temporary object on the \
-stack upon returning to the caller. This will be a dangling reference}}
+stack upon returning to the caller. This will be a dangling reference}}
UntypedAllocaTest() : allocaPtr(__builtin_alloca(sizeof(int))) {
// All good!
}
@@ -104,7 +104,7 @@ struct TypedAllocaTest1 {
: allocaPtr(static_cast<int *>(__builtin_alloca(sizeof(int)))) {}
// expected-warning-re at -2 {{Address of stack memory allocated by call to \
alloca() on line {{[0-9]+}} is still referred to by a temporary object on the \
-stack upon returning to the caller. This will be a dangling reference}}
+stack upon returning to the caller. This will be a dangling reference}}
};
void fTypedAllocaTest1() {
@@ -117,7 +117,7 @@ struct TypedAllocaTest2 {
// expected-warning-re at +5 {{Address of stack memory allocated by call to \
alloca() on line {{[0-9]+}} is still referred to by a temporary object on the \
-stack upon returning to the caller. This will be a dangling reference}}
+stack upon returning to the caller. This will be a dangling reference}}
TypedAllocaTest2()
: allocaPtr(static_cast<int *>(__builtin_alloca(sizeof(int)))) {
*allocaPtr = 55555;
@@ -370,7 +370,7 @@ class VoidPointerRRefTest1 {
public:
// expected-warning at +3 {{Address of stack memory associated with local \
variable 'vptr' is still referred to by a temporary object on the stack \
-upon returning to the caller. This will be a dangling reference}}
+upon returning to the caller. This will be a dangling reference}}
VoidPointerRRefTest1(void *vptr, char) : vptrrref(static_cast<void *&&>(vptr)) { // expected-warning {{binding reference member 'vptrrref' to stack allocated parameter 'vptr'}}
// All good!
}
@@ -388,7 +388,7 @@ class VoidPointerRRefTest2 {
public:
// expected-warning at +3 {{Address of stack memory associated with local \
variable 'vptr' is still referred to by a temporary object on the stack \
-upon returning to the caller. This will be a dangling reference}}
+upon returning to the caller. This will be a dangling reference}}
VoidPointerRRefTest2(void **vptr, char) : vpptrrref(static_cast<void **&&>(vptr)) { // expected-warning {{binding reference member 'vpptrrref' to stack allocated parameter 'vptr'}}
// All good!
}
@@ -406,7 +406,7 @@ class VoidPointerLRefTest {
public:
// expected-warning at +3 {{Address of stack memory associated with local \
variable 'vptr' is still referred to by a temporary object on the stack \
-upon returning to the caller. This will be a dangling reference}}
+upon returning to the caller. This will be a dangling reference}}
VoidPointerLRefTest(void *vptr, char) : vptrrref(static_cast<void *&>(vptr)) { // expected-warning {{binding reference member 'vptrrref' to stack allocated parameter 'vptr'}}
// All good!
}
diff --git a/clang/test/Analysis/dispatch-once.m b/clang/test/Analysis/dispatch-once.m
index fa84f563815dd6..045aded3fd192e 100644
--- a/clang/test/Analysis/dispatch-once.m
+++ b/clang/test/Analysis/dispatch-once.m
@@ -21,7 +21,7 @@
void test_stack(void) {
dispatch_once_t once;
- dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the local variable 'once' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?}}
+ dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the local variable 'once' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?}}
}
void test_static_local(void) {
@@ -32,7 +32,7 @@ void test_static_local(void) {
void test_heap_var(void) {
dispatch_once_t *once = calloc(1, sizeof(dispatch_once_t));
// Use regexps to check that we're NOT suggesting to make this static.
- dispatch_once(once, ^{}); // expected-warning-re{{{{^Call to 'dispatch_once' uses heap-allocated memory for the predicate value. Using such transient memory for the predicate is potentially dangerous$}}}}
+ dispatch_once(once, ^{}); // expected-warning-re{{{{^Call to 'dispatch_once' uses heap-allocated memory for the predicate value. Using such transient memory for the predicate is potentially dangerous$}}}}
}
void test_external_pointer(dispatch_once_t *once) {
diff --git a/clang/test/Analysis/incorrect-checker-names.cpp b/clang/test/Analysis/incorrect-checker-names.cpp
index 8dee0b6f468581..3808b2b4f84ac5 100644
--- a/clang/test/Analysis/incorrect-checker-names.cpp
+++ b/clang/test/Analysis/incorrect-checker-names.cpp
@@ -16,5 +16,5 @@ char const *p;
void f0() {
char const str[] = "This will change";
p = str;
-} // expected-warning at -1{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
-// expected-note at -2{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
+} // expected-warning at -1{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
+// expected-note at -2{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
diff --git a/clang/test/Analysis/retain-release-path-notes.m b/clang/test/Analysis/retain-release-path-notes.m
index 3c193c1e2bc4fd..5e5d32b0b1553e 100644
--- a/clang/test/Analysis/retain-release-path-notes.m
+++ b/clang/test/Analysis/retain-release-path-notes.m
@@ -112,7 +112,7 @@ CFTypeRef CFCopyRuleViolation (void) {
CFTypeRef CFGetRuleViolation (void) {
CFTypeRef object = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count}}
- return object; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation}}
+ return object; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation}}
}
@implementation Foo (FundamentalMemoryManagementRules)
@@ -133,7 +133,7 @@ - (id)copyViolationKeyedSubscript {
- (id)getViolation {
id result = [[Foo alloc] init]; // expected-note{{Method returns an instance of Foo with a +1 retain count}}
- return result; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa}}
+ return result; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa}}
}
- (id)copyAutorelease {
diff --git a/clang/test/Analysis/security-syntax-checks.m b/clang/test/Analysis/security-syntax-checks.m
index 154f0c1bae427c..e4699541dff63c 100644
--- a/clang/test/Analysis/security-syntax-checks.m
+++ b/clang/test/Analysis/security-syntax-checks.m
@@ -100,8 +100,8 @@ void test_getpw(void) {
void test_setuid(void)
{
- setuid(2); // expected-warning{{The return value from the call to 'setuid' is not checked. If an error occurs in 'setuid', the following code may execute with unexpected privileges}}
- setuid(0); // expected-warning{{The return value from the call to 'setuid' is not checked. If an error occurs in 'setuid', the following code may execute with unexpected privileges}}
+ setuid(2); // expected-warning{{The return value from the call to 'setuid' is not checked. If an error occurs in 'setuid', the following code may execute with unexpected privileges}}
+ setuid(0); // expected-warning{{The return value from the call to 'setuid' is not checked. If an error occurs in 'setuid', the following code may execute with unexpected privileges}}
if (setuid (2) != 0)
abort();
@@ -113,8 +113,8 @@ void test_setuid(void)
check(setuid (2)); // no-warning
- setreuid(2,2); // expected-warning{{The return value from the call to 'setreuid' is not checked. If an error occurs in 'setreuid', the following code may execute with unexpected privileges}}
- setregid(2,2); // expected-warning{{The return value from the call to 'setregid' is not checked. If an error occurs in 'setregid', the following code may execute with unexpected privileges}}
+ setreuid(2,2); // expected-warning{{The return value from the call to 'setreuid' is not checked. If an error occurs in 'setreuid', the following code may execute with unexpected privileges}}
+ setregid(2,2); // expected-warning{{The return value from the call to 'setregid' is not checked. If an error occurs in 'setregid', the following code may execute with unexpected privileges}}
}
// CWE-338: Use of cryptographically weak prng
@@ -135,16 +135,16 @@ void test_rand(void)
unsigned short a[7];
unsigned b;
- rand(); // expected-warning{{Function 'rand' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- drand48(); // expected-warning{{Function 'drand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- erand48(a); // expected-warning{{Function 'erand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- jrand48(a); // expected-warning{{Function 'jrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- lcong48(a); // expected-warning{{Function 'lcong48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- lrand48(); // expected-warning{{Function 'lrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- mrand48(); // expected-warning{{Function 'mrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- nrand48(a); // expected-warning{{Function 'nrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- rand_r(&b); // expected-warning{{Function 'rand_r' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- random(); // expected-warning{{The 'random' function produces a sequence of values that an adversary may be able to predict. Use 'arc4random' instead}}
+ rand(); // expected-warning{{Function 'rand' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ drand48(); // expected-warning{{Function 'drand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ erand48(a); // expected-warning{{Function 'erand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ jrand48(a); // expected-warning{{Function 'jrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ lcong48(a); // expected-warning{{Function 'lcong48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ lrand48(); // expected-warning{{Function 'lrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ mrand48(); // expected-warning{{Function 'mrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ nrand48(a); // expected-warning{{Function 'nrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ rand_r(&b); // expected-warning{{Function 'rand_r' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
+ random(); // expected-warning{{The 'random' function produces a sequence of values that an adversary may be able to predict. Use 'arc4random' instead}}
}
char *mktemp(char *buf);
diff --git a/clang/test/Analysis/stack-addr-ps.cpp b/clang/test/Analysis/stack-addr-ps.cpp
index 0ca7b074143065..3a14ce0ca55de5 100644
--- a/clang/test/Analysis/stack-addr-ps.cpp
+++ b/clang/test/Analysis/stack-addr-ps.cpp
@@ -373,7 +373,7 @@ void ***param_ptr_to_ptr_to_ptr_return(void ***ppp) {
int local = 0;
**ppp = &local;
return ppp;
- // expected-warning at -1 {{Address of stack memory associated with local variable 'local' is still referred to by the caller variable 'ppp' upon returning to the caller. This will be a dangling reference}}
+ // expected-warning at -1 {{Address of stack memory associated with local variable 'local' is still referred to by the caller variable 'ppp' upon returning to the caller. This will be a dangling reference}}
}
void param_ptr_to_ptr_to_ptr_caller(void** pp) {
@@ -568,7 +568,7 @@ S returned_struct_with_ptr_callee() {
int local = 42;
S s;
s.p = &local;
- return s; // expected-warning {{Address of stack memory associated with local variable 'local' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'local' is still referred to by the caller variable 's' upon returning to the caller. This will be a dangling reference}}
+ return s; // expected-warning {{Address of stack memory associated with local variable 'local' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'local' is still referred to by the caller variable 's' upon returning to the caller. This will be a dangling reference}}
}
S leak_through_field_of_returned_object() {
diff --git a/clang/test/Analysis/stack-capture-leak-no-arc.mm b/clang/test/Analysis/stack-capture-leak-no-arc.mm
index 71145d05072d77..03b3811be38327 100644
--- a/clang/test/Analysis/stack-capture-leak-no-arc.mm
+++ b/clang/test/Analysis/stack-capture-leak-no-arc.mm
@@ -40,7 +40,7 @@ dispatch_block_t test_block_inside_block_async_leak() {
// called.
void output_block(dispatch_block_t * blk) {
int x = 0;
- *blk = ^{ f(x); }; // expected-warning {{Address of stack-allocated block declared on line 43 is still referred to by the caller variable 'blk' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
+ *blk = ^{ f(x); }; // expected-warning {{Address of stack-allocated block declared on line 43 is still referred to by the caller variable 'blk' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
}
// The block literal captures nothing thus is treated as a constant.
@@ -54,7 +54,7 @@ void test_block_leak() {
__block dispatch_block_t blk;
int x = 0;
dispatch_block_t p = ^{
- blk = ^{ // expected-warning {{Address of stack-allocated block declared on line 57 is still referred to by the caller variable 'blk' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
+ blk = ^{ // expected-warning {{Address of stack-allocated block declared on line 57 is still referred to by the caller variable 'blk' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
f(x);
};
};
diff --git a/clang/test/Analysis/stackaddrleak.c b/clang/test/Analysis/stackaddrleak.c
index 96bd4e4ea19e5f..1ec129333a7fec 100644
--- a/clang/test/Analysis/stackaddrleak.c
+++ b/clang/test/Analysis/stackaddrleak.c
@@ -7,7 +7,7 @@ char const *p;
void f0(void) {
char const str[] = "This will change";
p = str;
-} // expected-warning at -1{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
+} // expected-warning at -1{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
void f1(void) {
char const str[] = "This will change";
@@ -17,7 +17,7 @@ void f1(void) {
void f2(void) {
p = (const char *) __builtin_alloca(12);
-} // expected-warning at -1{{Address of stack memory allocated by call to alloca() on line 19 is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
+} // expected-warning at -1{{Address of stack memory allocated by call to alloca() on line 19 is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
// PR 7383 - previously the stack address checker would crash on this example
// because it would attempt to do a direct load from 'pr7383_list'.
diff --git a/clang/test/Analysis/stackaddrleak.cpp b/clang/test/Analysis/stackaddrleak.cpp
index df202a2fee7762..74120fd9fdd4e8 100644
--- a/clang/test/Analysis/stackaddrleak.cpp
+++ b/clang/test/Analysis/stackaddrleak.cpp
@@ -18,7 +18,7 @@ struct myfunction {
myfunction create_func() {
int n;
auto c = [&n] {};
- return c; // expected-warning {{Address of stack memory associated with local variable 'n' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'n' is still referred to by a temporary object on the stack upon returning to the caller. This will be a dangling reference}}
+ return c; // expected-warning {{Address of stack memory associated with local variable 'n' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'n' is still referred to by a temporary object on the stack upon returning to the caller. This will be a dangling reference}}
}
void gh_66221() {
create_func()();
>From f294cdd90eb0f1e0440fbe58a468fd08a2e60e45 Mon Sep 17 00:00:00 2001
From: benedekaibas <kaibas01 at allegheny.edu>
Date: Thu, 15 Oct 2026 16:00:56 +0200
Subject: [PATCH 3/5] Remove a leftover double space and fix clang formating.
---
clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
index 0a55d1da7f91bc..3f1a067d9d1f45 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
@@ -436,9 +436,9 @@ void UnixAPIMisuseChecker::CheckPthreadOnce(CheckerContext &C,
else
os << " stack allocated memory";
os << " for the \"control\" value. Using such transient memory for "
- "the control value is potentially dangerous.";
+ "the control value is potentially dangerous.";
if (isa<VarRegion>(R) && R->hasMemorySpace<StackLocalsSpaceRegion>(state))
- os << " Perhaps you intended to declare the variable as 'static'?";
+ os << " Perhaps you intended to declare the variable as 'static'?";
auto report =
std::make_unique<PathSensitiveBugReport>(BT_pthreadOnce, os.str(), N);
>From eab194a6340af227cdc7fd86c31c0b1808aeac80 Mon Sep 17 00:00:00 2001
From: benedekaibas <kaibas01 at allegheny.edu>
Date: Sun, 25 Oct 2026 22:16:04 +0100
Subject: [PATCH 4/5] Remove dot from sentences when there is another sentence
following it
---
.../Checkers/CheckObjCInstMethSignature.cpp | 2 +-
.../Checkers/MacOSXAPIChecker.cpp | 4 +-
.../RetainCountDiagnostics.cpp | 6 +--
.../Checkers/UnixAPIChecker.cpp | 4 +-
.../retain-release-path-notes.m.plist | 8 ++--
.../retain-release.m.objc.plist | 40 +++++++++----------
.../retain-release.m.objcpp.plist | 40 +++++++++----------
.../Inputs/expected-plists/unix-fns.c.plist | 18 ++++-----
clang/test/Analysis/dispatch-once.m | 2 +-
.../test/Analysis/retain-release-path-notes.m | 4 +-
10 files changed, 64 insertions(+), 64 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
index 010c7589cfca12..1ab9118a76a735 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
@@ -61,7 +61,7 @@ static void CompareReturnTypes(const ObjCMethodDecl *MethDerived,
<< *MethAncestor->getClassInterface() << "' and has a return type of '"
<< ResAncestor
<< "'. These two types are incompatible, and may result in undefined "
- "behavior for clients of these classes.";
+ "behavior for clients of these classes";
PathDiagnosticLocation MethDLoc =
PathDiagnosticLocation::createBegin(MethDerived,
diff --git a/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
index 9de17198f6bc4f..017ffaf5158072 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
@@ -126,9 +126,9 @@ void MacOSXAPIChecker::CheckDispatchOnce(CheckerContext &C, const CallExpr *CE,
os << " stack allocated memory";
}
os << " for the predicate value. Using such transient memory for "
- "the predicate is potentially dangerous.";
+ "the predicate is potentially dangerous";
if (SuggestStatic)
- os << " Perhaps you intended to declare the variable as 'static'?";
+ os << "; perhaps you intended to declare the variable as 'static'?";
ExplodedNode *N = C.generateErrorNode();
if (!N)
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
index 10a75aa5874d98..4c7af02283c133 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
@@ -745,8 +745,8 @@ RefLeakReportVisitor::getEndPath(const ExplodedNode *EndN,
} else {
os << "whose name ('" << MD->getSelector().getAsString()
<< "') does not start with "
- "'copy', 'mutableCopy', 'alloc' or 'new'."
- " This violates the naming convention rules"
+ "'copy', 'mutableCopy', 'alloc' or 'new';"
+ " violating the naming convention rules"
" given in the Memory Management Guide for Cocoa";
}
} else {
@@ -754,7 +754,7 @@ RefLeakReportVisitor::getEndPath(const ExplodedNode *EndN,
ObjKind K = RV->getObjKind();
if (K == ObjKind::ObjC || K == ObjKind::CF) {
os << "whose name ('" << *FD
- << "') does not contain 'Copy' or 'Create'. This violates the "
+ << "') does not contain 'Copy' or 'Create'; violating the "
"naming convention rules given in the Memory Management Guide "
"for Core Foundation";
} else if (RV->getObjKind() == ObjKind::OS) {
diff --git a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
index 3f1a067d9d1f45..f783168cfc613d 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
@@ -436,9 +436,9 @@ void UnixAPIMisuseChecker::CheckPthreadOnce(CheckerContext &C,
else
os << " stack allocated memory";
os << " for the \"control\" value. Using such transient memory for "
- "the control value is potentially dangerous.";
+ "the control value is potentially dangerous;";
if (isa<VarRegion>(R) && R->hasMemorySpace<StackLocalsSpaceRegion>(state))
- os << " Perhaps you intended to declare the variable as 'static'?";
+ os << " perhaps you intended to declare the variable as 'static'?";
auto report =
std::make_unique<PathSensitiveBugReport>(BT_pthreadOnce, os.str(), N);
diff --git a/clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist b/clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
index e9f4f7577649ee..206590ef964984 100644
--- a/clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
@@ -2189,9 +2189,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object stored into 'object'</string>
@@ -2673,9 +2673,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object stored into 'result'</string>
diff --git a/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist b/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist
index 5c4ea431696f15..647ba33b035745 100644
--- a/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist
@@ -1651,9 +1651,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: object allocated and stored into 'date' is returned from a function whose name ('f7') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: object allocated and stored into 'date' is returned from a function whose name ('f7') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: object allocated and stored into 'date' is returned from a function whose name ('f7') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: object allocated and stored into 'date' is returned from a function whose name ('f7') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object stored into 'date'</string>
@@ -12124,9 +12124,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('NoCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('NoCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('NoCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('NoCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'NSString *'</string>
@@ -12209,9 +12209,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('noCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('noCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('noCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('noCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'NSString *'</string>
@@ -12786,9 +12786,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name (':') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name (':') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name (':') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name (':') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'NSString *'</string>
@@ -18436,9 +18436,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetained') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetained') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetained') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetained') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFDateRef'</string>
@@ -18699,9 +18699,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetainedAsCF') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetainedAsCF') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetainedAsCF') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetainedAsCF') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFDateRef'</string>
@@ -19980,9 +19980,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_createno') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_createno') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_createno') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_createno') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFMutableArrayRef'</string>
@@ -20066,9 +20066,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_copying') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_copying') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_copying') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_copying') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFMutableArrayRef'</string>
@@ -20152,9 +20152,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_creat') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_creat') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_creat') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_creat') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFMutableArrayRef'</string>
@@ -20238,9 +20238,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_copymachine') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_copymachine') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_copymachine') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_copymachine') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFMutableArrayRef'</string>
diff --git a/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist b/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist
index ccf7849e5fab69..7fab01d665b333 100644
--- a/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist
@@ -1651,9 +1651,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: object allocated and stored into 'date' is returned from a function whose name ('f7') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: object allocated and stored into 'date' is returned from a function whose name ('f7') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: object allocated and stored into 'date' is returned from a function whose name ('f7') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: object allocated and stored into 'date' is returned from a function whose name ('f7') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object stored into 'date'</string>
@@ -12124,9 +12124,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('NoCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('NoCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('NoCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('NoCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'NSString *'</string>
@@ -12209,9 +12209,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('noCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('noCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('noCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name ('noCopyString') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'NSString *'</string>
@@ -12786,9 +12786,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name (':') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name (':') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name (':') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'NSString *' is returned from a method whose name (':') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'NSString *'</string>
@@ -18505,9 +18505,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetained') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetained') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetained') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetained') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFDateRef'</string>
@@ -18768,9 +18768,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetainedAsCF') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetainedAsCF') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetainedAsCF') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa</string>
+ <string>Object leaked: allocated object of type 'CFDateRef' is returned from a method whose name ('alsoReturnsRetainedAsCF') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFDateRef'</string>
@@ -20049,9 +20049,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_createno') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_createno') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_createno') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_createno') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFMutableArrayRef'</string>
@@ -20135,9 +20135,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_copying') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_copying') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_copying') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camelcase_copying') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFMutableArrayRef'</string>
@@ -20221,9 +20221,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_creat') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_creat') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_creat') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_creat') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFMutableArrayRef'</string>
@@ -20307,9 +20307,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_copymachine') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_copymachine') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
<key>message</key>
- <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_copymachine') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation</string>
+ <string>Object leaked: allocated object of type 'CFMutableArrayRef' is returned from a function whose name ('camel_copymachine') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation</string>
</dict>
</array>
<key>description</key><string>Potential leak of an object of type 'CFMutableArrayRef'</string>
diff --git a/clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist b/clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist
index d7913cbc338fd0..d52a7e3cbe3117 100644
--- a/clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist
@@ -551,12 +551,12 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>message</key>
- <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
</dict>
</array>
- <key>description</key><string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <key>description</key><string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>category</key><string>API Misuse (Apple)</string>
<key>type</key><string>Improper use of 'dispatch_once'</string>
<key>check_name</key><string>osx.API</string>
@@ -643,12 +643,12 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>message</key>
- <string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
</dict>
</array>
- <key>description</key><string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <key>description</key><string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>category</key><string>Unix API</string>
<key>type</key><string>Improper use of 'pthread_once'</string>
<key>check_name</key><string>unix.API</string>
@@ -1463,12 +1463,12 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>message</key>
- <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
</dict>
</array>
- <key>description</key><string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?</string>
+ <key>description</key><string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>category</key><string>API Misuse (Apple)</string>
<key>type</key><string>Improper use of 'dispatch_once'</string>
<key>check_name</key><string>osx.API</string>
diff --git a/clang/test/Analysis/dispatch-once.m b/clang/test/Analysis/dispatch-once.m
index 045aded3fd192e..9289c1ce5bfc56 100644
--- a/clang/test/Analysis/dispatch-once.m
+++ b/clang/test/Analysis/dispatch-once.m
@@ -21,7 +21,7 @@
void test_stack(void) {
dispatch_once_t once;
- dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the local variable 'once' for the predicate value. Using such transient memory for the predicate is potentially dangerous. Perhaps you intended to declare the variable as 'static'?}}
+ dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the local variable 'once' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?}}
}
void test_static_local(void) {
diff --git a/clang/test/Analysis/retain-release-path-notes.m b/clang/test/Analysis/retain-release-path-notes.m
index 5e5d32b0b1553e..a50a1bd313a9e4 100644
--- a/clang/test/Analysis/retain-release-path-notes.m
+++ b/clang/test/Analysis/retain-release-path-notes.m
@@ -112,7 +112,7 @@ CFTypeRef CFCopyRuleViolation (void) {
CFTypeRef CFGetRuleViolation (void) {
CFTypeRef object = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count}}
- return object; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation}}
+ return object; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'; violating the naming convention rules given in the Memory Management Guide for Core Foundation}}
}
@implementation Foo (FundamentalMemoryManagementRules)
@@ -133,7 +133,7 @@ - (id)copyViolationKeyedSubscript {
- (id)getViolation {
id result = [[Foo alloc] init]; // expected-note{{Method returns an instance of Foo with a +1 retain count}}
- return result; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa}}
+ return result; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'; violating the naming convention rules given in the Memory Management Guide for Cocoa}}
}
- (id)copyAutorelease {
>From 70f000af736c7819db7ace2881cb716ce8d83cc6 Mon Sep 17 00:00:00 2001
From: benedekaibas <kaibas01 at allegheny.edu>
Date: Mon, 26 Oct 2026 17:07:37 +0100
Subject: [PATCH 5/5] Rewrite diagnostics to use ; instead of separate
sentences.
---
.../Checkers/CheckObjCInstMethSignature.cpp | 4 +-
.../Checkers/CheckSecuritySyntaxOnly.cpp | 33 ++++----
.../Checkers/LocalizationChecker.cpp | 4 +-
.../StaticAnalyzer/Checkers/MIGChecker.cpp | 4 +-
.../Checkers/MacOSXAPIChecker.cpp | 2 +-
.../StaticAnalyzer/Checkers/MallocChecker.cpp | 2 +-
.../Checkers/MmapWriteExecChecker.cpp | 2 +-
.../Checkers/NSErrorChecker.cpp | 2 +-
.../Checkers/PaddingChecker.cpp | 6 +-
.../Checkers/PthreadLockChecker.cpp | 2 +-
.../Checkers/StackAddrEscapeChecker.cpp | 2 +-
.../Checkers/StdLibraryFunctionsChecker.cpp | 2 +-
.../StaticAnalyzer/Checkers/StreamChecker.cpp | 14 ++--
.../Checkers/UnixAPIChecker.cpp | 6 +-
.../WebKit/RetainPtrCtorAdoptChecker.cpp | 4 +-
clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 18 ++---
.../test/Analysis/ArrayBound/verbose-tests.c | 2 +-
clang/test/Analysis/CheckNSError.m | 6 +-
...eckThatArraySubsciptNodeIsNotCollected.cpp | 2 +-
.../WebKit/retain-ptr-ctor-adopt-use-arc.mm | 26 +++---
.../WebKit/retain-ptr-ctor-adopt-use.mm | 26 +++---
.../Inputs/expected-plists/unix-fns.c.plist | 18 ++---
clang/test/Analysis/c11lock.c | 2 +-
clang/test/Analysis/const-method-call.cpp | 2 +-
.../cxx-uninitialized-object-ptr-ref.cpp | 12 +--
clang/test/Analysis/dangling-ptr-deref.cpp | 4 +-
.../diagnostics/track_subexpressions.cpp | 8 +-
clang/test/Analysis/dispatch-once.m | 30 +++----
clang/test/Analysis/fuchsia_lock.c | 4 +-
.../test/Analysis/incorrect-checker-names.cpp | 4 +-
.../test/Analysis/incorrect-checker-names.mm | 4 +-
clang/test/Analysis/localization.m | 18 ++---
clang/test/Analysis/loop-widening-notes.cpp | 16 ++--
clang/test/Analysis/loop-widening.cpp | 4 +-
clang/test/Analysis/mig.mm | 20 ++---
clang/test/Analysis/mmap-writeexec.c | 6 +-
clang/test/Analysis/padding_message.cpp | 80 +++++++++----------
clang/test/Analysis/pthreadlock.c | 10 +--
clang/test/Analysis/return-ptr-range.cpp | 4 +-
.../Analysis/security-syntax-checks-nscoder.m | 2 +-
clang/test/Analysis/security-syntax-checks.c | 10 +--
clang/test/Analysis/security-syntax-checks.m | 36 ++++-----
clang/test/Analysis/stack-addr-ps.cpp | 4 +-
.../Analysis/stack-capture-leak-no-arc.mm | 4 +-
clang/test/Analysis/stackaddrleak.c | 4 +-
clang/test/Analysis/stackaddrleak.cpp | 2 +-
...ibrary-functions-arg-constraints-notes.cpp | 4 +-
clang/test/Analysis/stream-note.c | 40 +++++-----
.../Analysis/stream-notes-missing-close.cpp | 32 ++++----
clang/test/Analysis/stream.c | 6 +-
clang/test/Analysis/stream.cpp | 2 +-
.../track-control-dependency-conditions.cpp | 6 +-
clang/test/Analysis/use-after-move.cpp | 46 +++++------
.../test/Analysis/void-call-exit-modelling.c | 4 +-
54 files changed, 308 insertions(+), 309 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
index 1ab9118a76a735..88a56de59ea9bb 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp
@@ -56,11 +56,11 @@ static void CompareReturnTypes(const ObjCMethodDecl *MethDerived,
<< "', defines the instance method '";
MethDerived->getSelector().print(os);
os << "' whose return type is '" << ResDerived
- << "'. A method with the same name (same selector) is also defined in "
+ << "'; a method with the same name (same selector) is also defined in "
"class '"
<< *MethAncestor->getClassInterface() << "' and has a return type of '"
<< ResAncestor
- << "'. These two types are incompatible, and may result in undefined "
+ << "'; these two types are incompatible, and may result in undefined "
"behavior for clients of these classes";
PathDiagnosticLocation MethDLoc =
diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
index eeb6c99c91c6da..371369b1629ccc 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
@@ -544,10 +544,9 @@ void WalkAST::checkCall_getpw(const CallExpr *CE, const FunctionDecl *FD) {
PathDiagnosticLocation CELoc =
PathDiagnosticLocation::createBegin(CE, BR.getSourceManager(), AC);
BR.EmitBasicReport(AC->getDecl(), filter.checkName_getpw,
- "Potential buffer overflow in call to 'getpw'",
- "Security",
+ "Potential buffer overflow in call to 'getpw'", "Security",
"The getpw() function is dangerous as it may overflow the "
- "provided buffer. It is obsoleted by getpwuid().",
+ "provided buffer; it is obsoleted by getpwuid()",
CELoc, CE->getCallee()->getSourceRange());
}
@@ -588,7 +587,7 @@ void WalkAST::checkCall_mktemp(const CallExpr *CE, const FunctionDecl *FD) {
"Potential insecure temporary file in call 'mktemp'",
"Security",
"Call to function 'mktemp' is insecure as it always "
- "creates or uses insecure temporary file. Use 'mkstemp' "
+ "creates or uses insecure temporary file; use 'mkstemp' "
"instead",
CELoc, CE->getCallee()->getSourceRange());
}
@@ -708,9 +707,9 @@ void WalkAST::checkCall_strcpy(const CallExpr *CE, const FunctionDecl *FD) {
"call 'strcpy'",
"Security",
"Call to function 'strcpy' is insecure as it does not "
- "provide bounding of the memory buffer. Replace "
+ "provide bounding of the memory buffer; replace "
"unbounded copy functions with analogous functions that "
- "support length arguments such as 'strlcpy'. CWE-119.",
+ "support length arguments such as 'strlcpy'; CWE-119",
CELoc, CE->getCallee()->getSourceRange());
}
@@ -736,9 +735,9 @@ void WalkAST::checkCall_strcat(const CallExpr *CE, const FunctionDecl *FD) {
"call 'strcat'",
"Security",
"Call to function 'strcat' is insecure as it does not "
- "provide bounding of the memory buffer. Replace "
+ "provide bounding of the memory buffer; replace "
"unbounded copy functions with analogous functions that "
- "support length arguments such as 'strlcat'. CWE-119.",
+ "support length arguments such as 'strlcat'; CWE-119",
CELoc, CE->getCallee()->getSourceRange());
}
@@ -812,7 +811,7 @@ void WalkAST::checkDeprecatedOrUnsafeBufferHandling(const CallExpr *CE,
}
Out2 << "security checks introduced "
- "in the C11 standard. Replace with analogous functions that "
+ "in the C11 standard; replace with analogous functions that "
"support length arguments or provides boundary checks such as '"
<< Name << "_s' in case of C11";
@@ -892,8 +891,8 @@ void WalkAST::checkCall_rand(const CallExpr *CE, const FunctionDecl *FD) {
SmallString<256> buf2;
llvm::raw_svector_ostream os2(buf2);
os2 << "Function '" << *FD
- << "' is obsolete because it implements a poor random number generator."
- << " Use 'arc4random' instead";
+ << "' is obsolete because it implements a poor random number generator;"
+ << " use 'arc4random' instead";
PathDiagnosticLocation CELoc =
PathDiagnosticLocation::createBegin(CE, BR.getSourceManager(), AC);
@@ -922,7 +921,7 @@ void WalkAST::checkCall_random(const CallExpr *CE, const FunctionDecl *FD) {
"'random' is not a secure random number generator",
"Security",
"The 'random' function produces a sequence of values that "
- "an adversary may be able to predict. Use 'arc4random' "
+ "an adversary may be able to predict; use 'arc4random' "
"instead",
CELoc, CE->getCallee()->getSourceRange());
}
@@ -944,8 +943,8 @@ void WalkAST::checkCall_vfork(const CallExpr *CE, const FunctionDecl *FD) {
"call 'vfork'",
"Security",
"Call to function 'vfork' is insecure as it can lead to "
- "denial of service situations in the parent process. "
- "Replace calls to vfork with calls to the safer "
+ "denial of service situations in the parent process; "
+ "replace calls to vfork with calls to the safer "
"'posix_spawn' function",
CELoc, CE->getCallee()->getSourceRange());
}
@@ -995,8 +994,8 @@ void WalkAST::checkMsg_decodeValueOfObjCType(const ObjCMessageExpr *ME) {
AC->getDecl(), filter.checkName_decodeValueOfObjCType,
"Potential buffer overflow in '-decodeValueOfObjCType:at:'", "Security",
"Deprecated method '-decodeValueOfObjCType:at:' is insecure "
- "as it can lead to potential buffer overflows. Use the safer "
- "'-decodeValueOfObjCType:at:size:' method.",
+ "as it can lead to potential buffer overflows; use the safer "
+ "'-decodeValueOfObjCType:at:size:' method",
MELoc, ME->getSourceRange());
}
@@ -1065,7 +1064,7 @@ void WalkAST::checkUncheckedReturnValue(CallExpr *CE) {
SmallString<256> buf2;
llvm::raw_svector_ostream os2(buf2);
os2 << "The return value from the call to '" << *FD
- << "' is not checked. If an error occurs in '" << *FD
+ << "' is not checked; if an error occurs in '" << *FD
<< "', the following code may execute with unexpected privileges";
PathDiagnosticLocation CELoc =
diff --git a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
index 19aeebf588eeb2..36cc4b38fd6c68 100644
--- a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
@@ -1377,8 +1377,8 @@ void PluralMisuseChecker::MethodCrawler::reportPluralMisuseError(
// Generate the bug report.
BR.EmitBasicReport(AC->getDecl(), Checker, "Plural Misuse",
"Localizability Issue (Apple)",
- "Plural cases are not supported across all languages. "
- "Use a .stringsdict file instead",
+ "Plural cases are not supported across all languages; "
+ "use a .stringsdict file instead",
PathDiagnosticLocation(S, BR.getSourceManager(), AC));
}
diff --git a/clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
index 27efba5e29db06..324434b4dac742 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
@@ -278,8 +278,8 @@ void MIGChecker::checkReturnAux(const ReturnStmt *RS, CheckerContext &C) const {
auto R = std::make_unique<PathSensitiveBugReport>(
BT,
- "MIG callback fails with error after deallocating argument value. "
- "This is a use-after-free vulnerability because the caller will try to "
+ "MIG callback fails with error after deallocating argument value; "
+ "this is a use-after-free vulnerability because the caller will try to "
"deallocate it again",
N);
diff --git a/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
index 017ffaf5158072..bb09daf148ef23 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
@@ -125,7 +125,7 @@ void MacOSXAPIChecker::CheckDispatchOnce(CheckerContext &C, const CallExpr *CE,
} else {
os << " stack allocated memory";
}
- os << " for the predicate value. Using such transient memory for "
+ os << " for the predicate value; using such transient memory for "
"the predicate is potentially dangerous";
if (SuggestStatic)
os << "; perhaps you intended to declare the variable as 'static'?";
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 140ea90eafc4bd..8b4cf29dd76d07 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -2058,7 +2058,7 @@ void MallocChecker::checkTaintedness(CheckerContext &C, const CallEvent &Call,
Callee = Call.getCalleeIdentifier()->getName().str();
reportTaintBug(
Callee + " is called with a tainted (potentially attacker controlled) "
- "value. Make sure the value is bound checked.",
+ "value; make sure the value is bound checked",
State, C, TaintedSyms, Family);
}
diff --git a/clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp
index a0ab734dfabe5d..1758db710bfbf0 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp
@@ -76,7 +76,7 @@ void MmapWriteExecChecker::checkPreCall(const CallEvent &Call,
auto Report = std::make_unique<PathSensitiveBugReport>(
BT,
- "Both PROT_WRITE and PROT_EXEC flags are set. This can "
+ "Both PROT_WRITE and PROT_EXEC flags are set; this can "
"lead to exploitable memory regions, which could be overwritten "
"with malicious code",
N);
diff --git a/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
index 7ceef4d9a2c501..7b6f7775eb93a2 100644
--- a/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
@@ -252,7 +252,7 @@ void NSOrCFErrorDerefChecker::checkEvent(ImplicitNullDerefEvent event) const {
SmallString<128> Buf;
llvm::raw_svector_ostream os(Buf);
- os << "Potential null dereference. According to coding standards ";
+ os << "Potential null dereference; according to coding standards ";
os << (isNSError
? "in 'Creating and Returning NSError Objects' the parameter"
: "documented in CoreFoundation/CFError.h the parameter");
diff --git a/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
index c8d7b6555f3f42..8dd7e3bd54870f 100644
--- a/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
@@ -327,12 +327,12 @@ class PaddingChecker : public Checker<check::ASTDecl<TranslationUnitDecl>> {
}
Os << " (" << BaselinePad.getQuantity() << " padding bytes, where "
- << OptimalPad.getQuantity() << " is optimal). "
- << "Optimal fields order: ";
+ << OptimalPad.getQuantity() << " is optimal); "
+ << "optimal fields order: ";
for (const auto *FD : OptimalFieldsOrder)
Os << FD->getName() << ", ";
Os << "consider reordering the fields or adding explicit padding "
- "members.";
+ "members";
PathDiagnosticLocation CELoc =
PathDiagnosticLocation::create(RD, BR->getSourceManager());
diff --git a/clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
index 6a1c7a93fb7739..beb431046ed7cd 100644
--- a/clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
@@ -561,7 +561,7 @@ void PthreadLockChecker::ReleaseLockAux(const CallEvent &Call,
if (!LS.isEmpty()) {
if (WarnOnLockOrderReversal && LS.getHead() != lockR) {
reportBug(C, BT_lor, MtxExpr, lockR, CheckKind,
- "This was not the most recently acquired lock. Possible lock "
+ "This was not the most recently acquired lock; possible lock "
"order reversal",
LS.getHead());
return;
diff --git a/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
index 3ccfb7e15dda20..c188d4cd439b1a 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
@@ -585,7 +585,7 @@ void StackAddrEscapeChecker::checkEndFunction(const ReturnStmt *RS,
// Generate a report for this bug.
const StringRef CommonSuffix =
- " upon returning to the caller. This will be a dangling reference";
+ " upon returning to the caller; this will be a dangling reference";
SmallString<128> Buf;
llvm::raw_svector_ostream Out(Buf);
const SourceRange Range = genName(Out, Referred, Ctx.getASTContext());
diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
index f6a6e535f7638b..39eb7cd3aee21f 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
@@ -866,7 +866,7 @@ class StdLibraryFunctionsChecker
if (ValuesPrinted)
MsgOs << " but ";
else
- MsgOs << "is out of the accepted range; It ";
+ MsgOs << "is out of the accepted range; it ";
VC->describe(ValueConstraint::Violation, Call, C.getState(), Summary,
MsgOs);
Msg[0] = toupper(Msg[0]);
diff --git a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
index 92789eb462e74f..92ae7a87f039b4 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
@@ -1914,8 +1914,8 @@ ProgramStateRef StreamChecker::ensureStreamOpened(SVal StreamVal,
C.emitReport(std::make_unique<PathSensitiveBugReport>(
BT_UseAfterOpenFailed,
"Stream might be invalid after "
- "(re-)opening it has failed. "
- "Can cause undefined behaviour.",
+ "(re-)opening it has failed; "
+ "can cause undefined behaviour",
N));
return nullptr;
}
@@ -1928,8 +1928,8 @@ ProgramStateRef StreamChecker::ensureNoFilePositionIndeterminate(
SVal StreamVal, CheckerContext &C, ProgramStateRef State) const {
static const char *BugMessage =
"File position of the stream might be 'indeterminate' "
- "after a failed operation. "
- "Can cause undefined behavior.";
+ "after a failed operation; "
+ "can cause undefined behavior";
SymbolRef Sym = StreamVal.getAsSymbol();
if (!Sym)
@@ -2002,8 +2002,8 @@ void StreamChecker::reportFEofWarning(SymbolRef StreamSym, CheckerContext &C,
if (ExplodedNode *N = C.generateNonFatalErrorNode(State)) {
auto R = std::make_unique<PathSensitiveBugReport>(
BT_StreamEof,
- "Read function called when stream is in EOF state. "
- "Function has no effect.",
+ "Read function called when stream is in EOF state; "
+ "function has no effect",
N);
R->markInteresting(StreamSym);
C.emitReport(std::move(R));
@@ -2042,7 +2042,7 @@ StreamChecker::reportLeaks(const SmallVector<SymbolRef, 2> &LeakedSyms,
std::unique_ptr<PathSensitiveBugReport> R =
std::make_unique<PathSensitiveBugReport>(
BT_ResourceLeak,
- "Opened stream never closed. Potential resource leak.", Err,
+ "Opened stream never closed; potential resource leak", Err,
LocUsedForUniqueing, StreamOpenNode->getStackFrame()->getDecl());
R->markInteresting(LeakSym);
R->addVisitor<NoStreamStateChangeVisitor>(LeakSym, this);
diff --git a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
index f783168cfc613d..a5bfb0f633c5c9 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
@@ -435,10 +435,10 @@ void UnixAPIMisuseChecker::CheckPthreadOnce(CheckerContext &C,
os << " the local variable '" << VR->getDecl()->getName() << '\'';
else
os << " stack allocated memory";
- os << " for the \"control\" value. Using such transient memory for "
- "the control value is potentially dangerous;";
+ os << " for the \"control\" value; using such transient memory for "
+ "the control value is potentially dangerous";
if (isa<VarRegion>(R) && R->hasMemorySpace<StackLocalsSpaceRegion>(state))
- os << " perhaps you intended to declare the variable as 'static'?";
+ os << "; perhaps you intended to declare the variable as 'static'?";
auto report =
std::make_unique<PathSensitiveBugReport>(BT_pthreadOnce, os.str(), N);
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
index afa9fc7b1c4a4a..8a98f5f7bbd12a 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
@@ -578,7 +578,7 @@ class RetainPtrCtorAdoptChecker
llvm::raw_svector_ostream Os(Buf);
Os << "Incorrect use of " << Name
- << ". The argument is +0 and results in an use-after-free";
+ << "; the argument is +0 and results in an use-after-free";
if (condition)
Os << " " << condition;
Os << ".";
@@ -599,7 +599,7 @@ class RetainPtrCtorAdoptChecker
llvm::raw_svector_ostream Os(Buf);
Os << "Incorrect use of " << Name
- << ". The argument is +1 and results in a memory leak";
+ << "; the argument is +1 and results in a memory leak";
if (condition)
Os << " " << condition;
Os << ".";
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index 595f6b0090b41d..3d5b90f5f252f4 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -626,11 +626,11 @@ PathDiagnosticLocation PathDiagnosticBuilder::ExecutionContinues(
const PathDiagnosticLocation &Loc = ExecutionContinues(C);
if (Loc.asStmt())
- os << "Execution continues on line "
+ os << "execution continues on line "
<< getSourceManager().getExpansionLineNumber(Loc.asLocation())
<< '.';
else {
- os << "Execution jumps to the end of the ";
+ os << "execution jumps to the end of the ";
const Decl *D = C.getCurrStackFrame()->getDecl();
if (isa<ObjCMethodDecl>(D))
os << "method";
@@ -785,9 +785,9 @@ PathDiagnosticPieceRef PathDiagnosticBuilder::generateDiagForSwitchOP(
switch (S->getStmtClass()) {
default:
- os << "No cases match in the switch statement. "
- "Control jumps to line "
- << End.asLocation().getExpansionLineNumber();
+ os << "No cases match in the switch statement; "
+ "control jumps to line "
+ << End.asLocation().getExpansionLineNumber();
break;
case Stmt::DefaultStmtClass:
os << "Control jumps to the 'default' case at line "
@@ -956,7 +956,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge(
std::string sbuf;
llvm::raw_string_ostream os(sbuf);
- os << "Loop condition is true. ";
+ os << "Loop condition is true; ";
PathDiagnosticLocation End = ExecutionContinues(os, C);
if (const Stmt *S = End.asStmt())
@@ -972,7 +972,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge(
C.getActivePath().push_front(
std::make_shared<PathDiagnosticControlFlowPiece>(
- Start, End, "Loop condition is false. Exiting loop"));
+ Start, End, "Loop condition is false; exiting loop"));
}
break;
@@ -982,7 +982,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge(
std::string sbuf;
llvm::raw_string_ostream os(sbuf);
- os << "Loop condition is false. ";
+ os << "Loop condition is false; ";
PathDiagnosticLocation End = ExecutionContinues(os, C);
if (const Stmt *S = End.asStmt())
End = getEnclosingStmtLocation(S, C.getCurrStackFrame());
@@ -996,7 +996,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge(
C.getActivePath().push_front(
std::make_shared<PathDiagnosticControlFlowPiece>(
- Start, End, "Loop condition is true. Entering loop body"));
+ Start, End, "Loop condition is true; entering loop body"));
}
break;
diff --git a/clang/test/Analysis/ArrayBound/verbose-tests.c b/clang/test/Analysis/ArrayBound/verbose-tests.c
index 29e80947d2f541..d88688bfd27412 100644
--- a/clang/test/Analysis/ArrayBound/verbose-tests.c
+++ b/clang/test/Analysis/ArrayBound/verbose-tests.c
@@ -65,7 +65,7 @@ void gh86959(void) {
// Previously code like this produced many almost-identical bug reports that
// only differed in the offset value. Verify that now we only see one report.
- // expected-note at +1 {{Entering loop body}}
+ // expected-note at +1 {{entering loop body}}
while (rng())
TenElements[getIndex()] = 10;
// expected-warning at -1 {{Out of bound access to memory preceding 'TenElements'}}
diff --git a/clang/test/Analysis/CheckNSError.m b/clang/test/Analysis/CheckNSError.m
index 47a6b432cbe0ca..1f3c69b304c04b 100644
--- a/clang/test/Analysis/CheckNSError.m
+++ b/clang/test/Analysis/CheckNSError.m
@@ -27,7 +27,7 @@ - (BOOL)myMethodWhichMayFail4:(NSError **)error __attribute__((nonnull));
@implementation A
- (void)myMethodWhichMayFail:(NSError **)error { // expected-warning {{Method accepting NSError** should have a non-void return value to indicate whether or not an error occurred}}
- *error = [NSError errorWithDomain:@"domain" code:1 userInfo:0]; // expected-warning {{Potential null dereference. According to coding standards in 'Creating and Returning NSError Objects' the parameter may be null [osx.cocoa.NSError]}}
+ *error = [NSError errorWithDomain:@"domain" code:1 userInfo:0]; // expected-warning {{Potential null dereference; according to coding standards in 'Creating and Returning NSError Objects' the parameter may be null [osx.cocoa.NSError]}}
}
- (BOOL)myMethodWhichMayFail2:(NSError **)error { // no-warning
@@ -50,7 +50,7 @@ - (BOOL)myMethodWhichMayFail4:(NSError **)error { // no-warning
typedef struct __CFError* CFErrorRef;
void foo(CFErrorRef* error) { // expected-warning {{Function accepting CFErrorRef* should have a non-void return value to indicate whether or not an error occurred}}
- *error = 0; // expected-warning {{Potential null dereference. According to coding standards documented in CoreFoundation/CFError.h the parameter may be null [osx.coreFoundation.CFError]}}
+ *error = 0; // expected-warning {{Potential null dereference; according to coding standards documented in CoreFoundation/CFError.h the parameter may be null [osx.coreFoundation.CFError]}}
}
int f1(CFErrorRef* error) {
@@ -74,7 +74,7 @@ int __attribute__((nonnull)) f4(CFErrorRef *error) {
}
int __attribute__((nonnull(1))) f5(int *x, CFErrorRef *error) {
- *error = 0; // expected-warning {{Potential null dereference. According to coding standards documented in CoreFoundation/CFError.h the parameter may be null [osx.coreFoundation.CFError]}}
+ *error = 0; // expected-warning {{Potential null dereference; according to coding standards documented in CoreFoundation/CFError.h the parameter may be null [osx.coreFoundation.CFError]}}
return 0;
}
diff --git a/clang/test/Analysis/CheckThatArraySubsciptNodeIsNotCollected.cpp b/clang/test/Analysis/CheckThatArraySubsciptNodeIsNotCollected.cpp
index b1c0f339bd56cb..8fe4e4d5eb8506 100644
--- a/clang/test/Analysis/CheckThatArraySubsciptNodeIsNotCollected.cpp
+++ b/clang/test/Analysis/CheckThatArraySubsciptNodeIsNotCollected.cpp
@@ -22,7 +22,7 @@ void test() {
A *array[42];
A *found;
- for (index = 0; (array[index] = foo()); ++index) { // expected-note {{Loop condition is false. Execution continues on line 34}}
+ for (index = 0; (array[index] = foo()); ++index) { // expected-note {{Loop condition is false; execution continues on line 34}}
// expected-note at -1 {{Value assigned to 'index'}}
// expected-note at -2 {{Assigning value}}
// expected-note at -3 {{Assuming pointer value is null}}
diff --git a/clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use-arc.mm b/clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use-arc.mm
index 135fe651a9f16f..b761baab30ce30 100644
--- a/clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use-arc.mm
+++ b/clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use-arc.mm
@@ -23,21 +23,21 @@ void basic_correct() {
void basic_wrong() {
RetainPtr<SomeObj> ns1 = [[SomeObj alloc] init];
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
auto ns2 = adoptNS([ns1.get() next]);
- // expected-warning at -1{{Incorrect use of adoptNS. The argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptNS; the argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
auto ns3 = adoptNSNullable([ns1.get() next]);
- // expected-warning at -1{{Incorrect use of adoptNSNullable. The argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptNSNullable; the argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf1 = CFArrayCreateMutable(kCFAllocatorDefault, 10);
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf2 = adoptCF(provide_cf());
- // expected-warning at -1{{Incorrect use of adoptCF. The argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptCF; the argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFTypeRef> cf3 = SecTaskCreateFromSelf(kCFAllocatorDefault);
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
CFCopyArray(cf1);
// expected-warning at -1{{The return value is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf4 = adoptCFNullable(provide_cf());
- // expected-warning at -1{{Incorrect use of adoptCFNullable. The argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptCFNullable; the argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
}
void basic_correct_arc() {
@@ -280,15 +280,15 @@ -(void)basic_correct {
-(void)basic_wrong {
RetainPtr<SomeObj> ns1 = [[SomeObj alloc] init];
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
auto ns2 = adoptNS([ns1.get() next]);
- // expected-warning at -1{{Incorrect use of adoptNS. The argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptNS; the argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf1 = CFArrayCreateMutable(kCFAllocatorDefault, 10);
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf2 = adoptCF(provide_cf());
- // expected-warning at -1{{Incorrect use of adoptCF. The argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptCF; the argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFTypeRef> cf3 = SecTaskCreateFromSelf(kCFAllocatorDefault);
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
CFCopyArray(cf1);
// expected-warning at -1{{The return value is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
}
@@ -313,7 +313,7 @@ -(void)make_some_obj {
-(void)alloc_init_bad_order {
auto *obj = [NSObject alloc];
auto ptr = adoptNS([obj init]);
- // expected-warning at -1{{Incorrect use of adoptNS. The argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptNS; the argument is +0 and results in an use-after-free when ARC is disabled [alpha.webkit.RetainPtrCtorAdoptChecker]}}
}
-(void)alloc_init_good_order {
diff --git a/clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use.mm b/clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use.mm
index c337752d6bd217..9255c771056d1b 100644
--- a/clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use.mm
+++ b/clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use.mm
@@ -27,21 +27,21 @@ void basic_correct() {
void basic_wrong() {
RetainPtr<SomeObj> ns1 = [[SomeObj alloc] init];
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
auto ns2 = adoptNS([ns1.get() next]);
- // expected-warning at -1{{Incorrect use of adoptNS. The argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptNS; the argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
auto ns3 = adoptNSNullable([ns1.get() next]);
- // expected-warning at -1{{Incorrect use of adoptNSNullable. The argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptNSNullable; the argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf1 = CFArrayCreateMutable(kCFAllocatorDefault, 10);
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf2 = adoptCF(provide_cf());
- // expected-warning at -1{{Incorrect use of adoptCF. The argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptCF; the argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFTypeRef> cf3 = SecTaskCreateFromSelf(kCFAllocatorDefault);
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
CFCopyArray(cf1);
// expected-warning at -1{{The return value is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf4 = adoptCFNullable(provide_cf());
- // expected-warning at -1{{Incorrect use of adoptCFNullable. The argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptCFNullable; the argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
}
void basic_correct_arc() {
@@ -311,15 +311,15 @@ -(void)basic_correct {
-(void)basic_wrong {
RetainPtr<SomeObj> ns1 = [[SomeObj alloc] init];
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
auto ns2 = adoptNS([ns1.get() next]);
- // expected-warning at -1{{Incorrect use of adoptNS. The argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptNS; the argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf1 = CFArrayCreateMutable(kCFAllocatorDefault, 10);
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFMutableArrayRef> cf2 = adoptCF(provide_cf());
- // expected-warning at -1{{Incorrect use of adoptCF. The argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptCF; the argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
RetainPtr<CFTypeRef> cf3 = SecTaskCreateFromSelf(kCFAllocatorDefault);
- // expected-warning at -1{{Incorrect use of RetainPtr constructor. The argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of RetainPtr constructor; the argument is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
CFCopyArray(cf1);
// expected-warning at -1{{The return value is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
}
@@ -347,7 +347,7 @@ -(void)alloc_init_bad_order {
auto *obj = [NSObject alloc];
// expected-warning at -1{{The return value is +1 and results in a memory leak [alpha.webkit.RetainPtrCtorAdoptChecker]}}
auto ptr = adoptNS([obj init]);
- // expected-warning at -1{{Incorrect use of adoptNS. The argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
+ // expected-warning at -1{{Incorrect use of adoptNS; the argument is +0 and results in an use-after-free [alpha.webkit.RetainPtrCtorAdoptChecker]}}
}
-(void)alloc_init_good_order {
diff --git a/clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist b/clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist
index d52a7e3cbe3117..32a58ac1860f51 100644
--- a/clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/unix-fns.c.plist
@@ -551,12 +551,12 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value; using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>message</key>
- <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value; using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
</dict>
</array>
- <key>description</key><string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <key>description</key><string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value; using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>category</key><string>API Misuse (Apple)</string>
<key>type</key><string>Improper use of 'dispatch_once'</string>
<key>check_name</key><string>osx.API</string>
@@ -643,12 +643,12 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value; using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>message</key>
- <string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value; using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
</dict>
</array>
- <key>description</key><string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value. Using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <key>description</key><string>Call to 'pthread_once' uses the local variable 'pred' for the "control" value; using such transient memory for the control value is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>category</key><string>Unix API</string>
<key>type</key><string>Improper use of 'pthread_once'</string>
<key>check_name</key><string>unix.API</string>
@@ -1463,12 +1463,12 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value; using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>message</key>
- <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value; using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
</dict>
</array>
- <key>description</key><string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
+ <key>description</key><string>Call to 'dispatch_once' uses the local variable 'pred' for the predicate value; using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?</string>
<key>category</key><string>API Misuse (Apple)</string>
<key>type</key><string>Improper use of 'dispatch_once'</string>
<key>check_name</key><string>osx.API</string>
diff --git a/clang/test/Analysis/c11lock.c b/clang/test/Analysis/c11lock.c
index d04603c7e2cc1b..6f2cbdc35e9636 100644
--- a/clang/test/Analysis/c11lock.c
+++ b/clang/test/Analysis/c11lock.c
@@ -69,7 +69,7 @@ void bad6(void) {
void bad7(void) {
mtx_lock(&mtx1);
mtx_lock(&mtx2);
- mtx_unlock(&mtx1); // lor-warning {{This was not the most recently acquired lock. Possible lock order reversal}}
+ mtx_unlock(&mtx1); // lor-warning {{This was not the most recently acquired lock; possible lock order reversal}}
mtx_unlock(&mtx2);
}
diff --git a/clang/test/Analysis/const-method-call.cpp b/clang/test/Analysis/const-method-call.cpp
index 47467043363eac..3f7b7b93a5507c 100644
--- a/clang/test/Analysis/const-method-call.cpp
+++ b/clang/test/Analysis/const-method-call.cpp
@@ -314,6 +314,6 @@ template <typename R> class callable<R()> {
void entry() {
callable<bool()>{}.call().const_method();
- // expected-warning at -1 {{Address of stack memory associated with temporary object of type 'callable<bool ()>' is still referred to by the static variable 'L' upon returning to the caller. This will be a dangling reference}}
+ // expected-warning at -1 {{Address of stack memory associated with temporary object of type 'callable<bool ()>' is still referred to by the static variable 'L' upon returning to the caller; this will be a dangling reference}}
}
} // namespace gh77378
diff --git a/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp b/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
index 87ad5be8fb52f7..b5a02bbf59f95d 100644
--- a/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
+++ b/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
@@ -86,7 +86,7 @@ struct UntypedAllocaTest {
// expected-warning-re at +3 {{Address of stack memory allocated by call to \
alloca() on line {{[0-9]+}} is still referred to by a temporary object on the \
-stack upon returning to the caller. This will be a dangling reference}}
+stack upon returning to the caller; this will be a dangling reference}}
UntypedAllocaTest() : allocaPtr(__builtin_alloca(sizeof(int))) {
// All good!
}
@@ -104,7 +104,7 @@ struct TypedAllocaTest1 {
: allocaPtr(static_cast<int *>(__builtin_alloca(sizeof(int)))) {}
// expected-warning-re at -2 {{Address of stack memory allocated by call to \
alloca() on line {{[0-9]+}} is still referred to by a temporary object on the \
-stack upon returning to the caller. This will be a dangling reference}}
+stack upon returning to the caller; this will be a dangling reference}}
};
void fTypedAllocaTest1() {
@@ -117,7 +117,7 @@ struct TypedAllocaTest2 {
// expected-warning-re at +5 {{Address of stack memory allocated by call to \
alloca() on line {{[0-9]+}} is still referred to by a temporary object on the \
-stack upon returning to the caller. This will be a dangling reference}}
+stack upon returning to the caller; this will be a dangling reference}}
TypedAllocaTest2()
: allocaPtr(static_cast<int *>(__builtin_alloca(sizeof(int)))) {
*allocaPtr = 55555;
@@ -370,7 +370,7 @@ class VoidPointerRRefTest1 {
public:
// expected-warning at +3 {{Address of stack memory associated with local \
variable 'vptr' is still referred to by a temporary object on the stack \
-upon returning to the caller. This will be a dangling reference}}
+upon returning to the caller; this will be a dangling reference}}
VoidPointerRRefTest1(void *vptr, char) : vptrrref(static_cast<void *&&>(vptr)) { // expected-warning {{binding reference member 'vptrrref' to stack allocated parameter 'vptr'}}
// All good!
}
@@ -388,7 +388,7 @@ class VoidPointerRRefTest2 {
public:
// expected-warning at +3 {{Address of stack memory associated with local \
variable 'vptr' is still referred to by a temporary object on the stack \
-upon returning to the caller. This will be a dangling reference}}
+upon returning to the caller; this will be a dangling reference}}
VoidPointerRRefTest2(void **vptr, char) : vpptrrref(static_cast<void **&&>(vptr)) { // expected-warning {{binding reference member 'vpptrrref' to stack allocated parameter 'vptr'}}
// All good!
}
@@ -406,7 +406,7 @@ class VoidPointerLRefTest {
public:
// expected-warning at +3 {{Address of stack memory associated with local \
variable 'vptr' is still referred to by a temporary object on the stack \
-upon returning to the caller. This will be a dangling reference}}
+upon returning to the caller; this will be a dangling reference}}
VoidPointerLRefTest(void *vptr, char) : vptrrref(static_cast<void *&>(vptr)) { // expected-warning {{binding reference member 'vptrrref' to stack allocated parameter 'vptr'}}
// All good!
}
diff --git a/clang/test/Analysis/dangling-ptr-deref.cpp b/clang/test/Analysis/dangling-ptr-deref.cpp
index 1c026b5528921b..d0e6c1c9e700ed 100644
--- a/clang/test/Analysis/dangling-ptr-deref.cpp
+++ b/clang/test/Analysis/dangling-ptr-deref.cpp
@@ -72,9 +72,9 @@ void test_case_six() {
void test_case_seven() {
int *ptr = nullptr;
- // expected-note at +3 {{Loop condition is true. Entering loop body}}
+ // expected-note at +3 {{Loop condition is true; entering loop body}}
// expected-note at +2 {{Assuming 'i' is >= 10}}
- // expected-note at +1 {{Loop condition is false. Execution continues on line}}
+ // expected-note at +1 {{Loop condition is false; execution continues on line}}
for (int i = 0; i < 10; ++i) { // expected-note {{'i' initialized to 0}}
ptr = &i; // expected-note {{Value assigned to 'ptr'}}
escape(ptr);
diff --git a/clang/test/Analysis/diagnostics/track_subexpressions.cpp b/clang/test/Analysis/diagnostics/track_subexpressions.cpp
index 76cf9e3e242850..ec80405d457c15 100644
--- a/clang/test/Analysis/diagnostics/track_subexpressions.cpp
+++ b/clang/test/Analysis/diagnostics/track_subexpressions.cpp
@@ -37,8 +37,8 @@ void testArrayIndexTracking() {
int arr[10];
for (int i = 0; i < 3; ++i)
- // expected-note at -1 3{{Loop condition is true. Entering loop body}}
- // expected-note at -2 {{Loop condition is false. Execution continues on line 43}}
+ // expected-note at -1 3{{Loop condition is true; entering loop body}}
+ // expected-note at -2 {{Loop condition is false; execution continues on line 43}}
arr[i] = 0;
int x = getInt();
int n = getIndex(x); // expected-note {{Calling 'getIndex'}}
@@ -69,8 +69,8 @@ void testArrayIndexTracking() {
int arr[2][10];
for (int i = 0; i < 3; ++i)
- // expected-note at -1 3{{Loop condition is true. Entering loop body}}
- // expected-note at -2 {{Loop condition is false. Execution continues on line 75}}
+ // expected-note at -1 3{{Loop condition is true; entering loop body}}
+ // expected-note at -2 {{Loop condition is false; execution continues on line 75}}
arr[1][i] = 0;
int x = getInt();
int n = getIndex(x); // expected-note {{Calling 'getIndex'}}
diff --git a/clang/test/Analysis/dispatch-once.m b/clang/test/Analysis/dispatch-once.m
index 9289c1ce5bfc56..2aa2237297cbbd 100644
--- a/clang/test/Analysis/dispatch-once.m
+++ b/clang/test/Analysis/dispatch-once.m
@@ -21,7 +21,7 @@
void test_stack(void) {
dispatch_once_t once;
- dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the local variable 'once' for the predicate value. Using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?}}
+ dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the local variable 'once' for the predicate value; using such transient memory for the predicate is potentially dangerous; perhaps you intended to declare the variable as 'static'?}}
}
void test_static_local(void) {
@@ -32,7 +32,7 @@ void test_static_local(void) {
void test_heap_var(void) {
dispatch_once_t *once = calloc(1, sizeof(dispatch_once_t));
// Use regexps to check that we're NOT suggesting to make this static.
- dispatch_once(once, ^{}); // expected-warning-re{{{{^Call to 'dispatch_once' uses heap-allocated memory for the predicate value. Using such transient memory for the predicate is potentially dangerous$}}}}
+ dispatch_once(once, ^{}); // expected-warning-re{{{{^Call to 'dispatch_once' uses heap-allocated memory for the predicate value; using such transient memory for the predicate is potentially dangerous$}}}}
}
void test_external_pointer(dispatch_once_t *once) {
@@ -46,12 +46,12 @@ void test_external_pointer(dispatch_once_t *once) {
void test_local_struct(void) {
Struct s;
- dispatch_once(&s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the local variable 's' for the predicate value.}}
+ dispatch_once(&s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the local variable 's' for the predicate value}}
}
void test_heap_struct(void) {
Struct *s = calloc(1, sizeof(Struct));
- dispatch_once(&s->once, ^{}); // expected-warning{{Call to 'dispatch_once' uses heap-allocated memory for the predicate value.}}
+ dispatch_once(&s->once, ^{}); // expected-warning{{Call to 'dispatch_once' uses heap-allocated memory for the predicate value}}
}
@interface Object : NSObject {
@@ -66,44 +66,44 @@ - (void)test_ivar_struct_from_inside;
@implementation Object
- (void)test_ivar_from_inside {
- dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the instance variable 'once' for the predicate value.}}
+ dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the instance variable 'once' for the predicate value}}
}
- (void)test_ivar_struct_from_inside {
- dispatch_once(&s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 's' for the predicate value.}}
+ dispatch_once(&s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 's' for the predicate value}}
}
- (void)test_ivar_array_from_inside {
- dispatch_once(&once_array[1], ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 'once_array' for the predicate value.}}
+ dispatch_once(&once_array[1], ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 'once_array' for the predicate value}}
}
@end
void test_ivar_from_alloc_init(void) {
Object *o = [[Object alloc] init];
- dispatch_once(&o->once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the instance variable 'once' for the predicate value.}}
+ dispatch_once(&o->once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the instance variable 'once' for the predicate value}}
}
void test_ivar_struct_from_alloc_init(void) {
Object *o = [[Object alloc] init];
- dispatch_once(&o->s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 's' for the predicate value.}}
+ dispatch_once(&o->s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 's' for the predicate value}}
}
void test_ivar_array_from_alloc_init(void) {
Object *o = [[Object alloc] init];
- dispatch_once(&o->once_array[1], ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 'once_array' for the predicate value.}}
+ dispatch_once(&o->once_array[1], ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 'once_array' for the predicate value}}
}
void test_ivar_from_external_obj(Object *o) {
// ObjC object pointer always points to the heap.
- dispatch_once(&o->once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the instance variable 'once' for the predicate value.}}
+ dispatch_once(&o->once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the instance variable 'once' for the predicate value}}
}
void test_ivar_struct_from_external_obj(Object *o) {
- dispatch_once(&o->s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 's' for the predicate value.}}
+ dispatch_once(&o->s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 's' for the predicate value}}
}
void test_ivar_array_from_external_obj(Object *o) {
- dispatch_once(&o->once_array[1], ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 'once_array' for the predicate value.}}
+ dispatch_once(&o->once_array[1], ^{}); // expected-warning{{Call to 'dispatch_once' uses memory within the instance variable 'once_array' for the predicate value}}
}
void test_block_var_from_block(void) {
__block dispatch_once_t once;
^{
- dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the block variable 'once' for the predicate value.}}
+ dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the block variable 'once' for the predicate value}}
};
}
@@ -114,7 +114,7 @@ void test_block_var_from_outside_block(void) {
^{
use_block_var(&once);
};
- dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the block variable 'once' for the predicate value.}}
+ dispatch_once(&once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the block variable 'once' for the predicate value}}
}
void test_static_var_from_outside_block(void) {
diff --git a/clang/test/Analysis/fuchsia_lock.c b/clang/test/Analysis/fuchsia_lock.c
index 1210ca69421508..d5f97728ed760a 100644
--- a/clang/test/Analysis/fuchsia_lock.c
+++ b/clang/test/Analysis/fuchsia_lock.c
@@ -45,7 +45,7 @@ void bad3(void) {
void bad4(void) {
spin_lock(&mtx1);
spin_lock(&mtx2);
- spin_unlock(&mtx1); // lor-warning {{This was not the most recently acquired lock. Possible lock order reversal}}
+ spin_unlock(&mtx1); // lor-warning {{This was not the most recently acquired lock; possible lock order reversal}}
spin_unlock(&mtx2);
}
@@ -94,7 +94,7 @@ void bad13(void) {
void bad14(void) {
sync_mutex_lock(&smtx1);
sync_mutex_lock(&smtx2);
- sync_mutex_unlock(&smtx1); // lor-warning {{This was not the most recently acquired lock. Possible lock order reversal}}
+ sync_mutex_unlock(&smtx1); // lor-warning {{This was not the most recently acquired lock; possible lock order reversal}}
sync_mutex_unlock(&smtx2);
}
diff --git a/clang/test/Analysis/incorrect-checker-names.cpp b/clang/test/Analysis/incorrect-checker-names.cpp
index 3808b2b4f84ac5..8ada3fd7fa6c2d 100644
--- a/clang/test/Analysis/incorrect-checker-names.cpp
+++ b/clang/test/Analysis/incorrect-checker-names.cpp
@@ -16,5 +16,5 @@ char const *p;
void f0() {
char const str[] = "This will change";
p = str;
-} // expected-warning at -1{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
-// expected-note at -2{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
+} // expected-warning at -1{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller; this will be a dangling reference [core.StackAddressEscape]}}
+// expected-note at -2{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller; this will be a dangling reference}}
diff --git a/clang/test/Analysis/incorrect-checker-names.mm b/clang/test/Analysis/incorrect-checker-names.mm
index 12cab9be1df18e..ee173f894d9fbc 100644
--- a/clang/test/Analysis/incorrect-checker-names.mm
+++ b/clang/test/Analysis/incorrect-checker-names.mm
@@ -107,7 +107,7 @@ + (id)errorWithDomain:(NSString *)domain code:(NSInteger)code userInfo:(NSDictio
void foo(CFErrorRef* error) { // expected-warning{{Function accepting CFErrorRef* should have a non-void return value to indicate whether or not an error occurred [osx.coreFoundation.CFError]}}
// FIXME: This shouldn't be tied to a modeling checker.
- *error = 0; // expected-warning {{Potential null dereference. According to coding standards documented in CoreFoundation/CFError.h the parameter may be null [osx.coreFoundation.CFError]}}
+ *error = 0; // expected-warning {{Potential null dereference; according to coding standards documented in CoreFoundation/CFError.h the parameter may be null [osx.coreFoundation.CFError]}}
}
@interface A
@@ -116,7 +116,7 @@ - (void)myMethodWhichMayFail:(NSError **)error;
@implementation A
- (void)myMethodWhichMayFail:(NSError **)error { // expected-warning {{Method accepting NSError** should have a non-void return value to indicate whether or not an error occurred [osx.cocoa.NSError]}}
- *error = [NSError errorWithDomain:@"domain" code:1 userInfo:0]; // expected-warning {{Potential null dereference. According to coding standards in 'Creating and Returning NSError Objects' the parameter may be null [osx.cocoa.NSError]}}
+ *error = [NSError errorWithDomain:@"domain" code:1 userInfo:0]; // expected-warning {{Potential null dereference; according to coding standards in 'Creating and Returning NSError Objects' the parameter may be null [osx.cocoa.NSError]}}
}
@end
diff --git a/clang/test/Analysis/localization.m b/clang/test/Analysis/localization.m
index 65d857cc9a46ea..f057c05634cbd9 100644
--- a/clang/test/Analysis/localization.m
+++ b/clang/test/Analysis/localization.m
@@ -118,14 +118,14 @@ - (void)debugScreen:(UILabel *)label {
- (NSString *)test1:(int)plural {
if (plural) {
- return MCLocalizedString(@"TYPE_PLURAL"); // expected-warning {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note {{Plural}}
+ return MCLocalizedString(@"TYPE_PLURAL"); // expected-warning {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note {{Plural}}
}
return MCLocalizedString(@"TYPE");
}
- (NSString *)test2:(int)numOfReminders {
if (numOfReminders > 0) {
- return [NSString stringWithFormat:@"%@, %@", @"Test", (numOfReminders != 1) ? [NSString stringWithFormat:NSLocalizedString(@"%@ Reminders", @"Plural count of reminders"), numOfReminders] : [NSString stringWithFormat:NSLocalizedString(@"1 reminder", @"One reminder")]]; // expected-warning 2 {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note 2 {{Plural}}
+ return [NSString stringWithFormat:@"%@, %@", @"Test", (numOfReminders != 1) ? [NSString stringWithFormat:NSLocalizedString(@"%@ Reminders", @"Plural count of reminders"), numOfReminders] : [NSString stringWithFormat:NSLocalizedString(@"1 reminder", @"One reminder")]]; // expected-warning 2 {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note 2 {{Plural}}
}
return nil;
}
@@ -134,18 +134,18 @@ - (void)test3 {
NSString *count;
if (self.unreadArticlesCount > 1)
{
- count = [count stringByAppendingFormat:@"%@", KHLocalizedString(@"New Stories", @"Plural count for new stories")]; // expected-warning {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note {{Plural}}
+ count = [count stringByAppendingFormat:@"%@", KHLocalizedString(@"New Stories", @"Plural count for new stories")]; // expected-warning {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note {{Plural}}
} else {
- count = [count stringByAppendingFormat:@"%@", KHLocalizedString(@"New Story", @"One new story")]; // expected-warning {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note {{Plural}}
+ count = [count stringByAppendingFormat:@"%@", KHLocalizedString(@"New Story", @"One new story")]; // expected-warning {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note {{Plural}}
}
}
- (NSString *)test4:(int)count {
if ( count == 1 )
{
- return [NSString stringWithFormat:KHLocalizedString(@"value.singular",nil), count]; // expected-warning {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note {{Plural}}
+ return [NSString stringWithFormat:KHLocalizedString(@"value.singular",nil), count]; // expected-warning {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note {{Plural}}
} else {
- return [NSString stringWithFormat:KHLocalizedString(@"value.plural",nil), count]; // expected-warning {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note {{Plural}}
+ return [NSString stringWithFormat:KHLocalizedString(@"value.plural",nil), count]; // expected-warning {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note {{Plural}}
}
}
@@ -153,9 +153,9 @@ - (NSString *)test5:(int)count {
int test = count == 1;
if (test)
{
- return [NSString stringWithFormat:KHLocalizedString(@"value.singular",nil), count]; // expected-warning {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note {{Plural}}
+ return [NSString stringWithFormat:KHLocalizedString(@"value.singular",nil), count]; // expected-warning {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note {{Plural}}
} else {
- return [NSString stringWithFormat:KHLocalizedString(@"value.plural",nil), count]; // expected-warning {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note {{Plural}}
+ return [NSString stringWithFormat:KHLocalizedString(@"value.plural",nil), count]; // expected-warning {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note {{Plural}}
}
}
@@ -169,7 +169,7 @@ - (NSString *)test6:(int)sectionIndex {
if (someOtherVariable)
return KHLocalizedString(@"OK",nil); // no-warning
} else {
- return KHLocalizedString(@"value.plural",nil); // expected-warning {{Plural cases are not supported across all languages. Use a .stringsdict file}} expected-note {{Plural}}
+ return KHLocalizedString(@"value.plural",nil); // expected-warning {{Plural cases are not supported across all languages; use a .stringsdict file}} expected-note {{Plural}}
}
return nil;
}
diff --git a/clang/test/Analysis/loop-widening-notes.cpp b/clang/test/Analysis/loop-widening-notes.cpp
index 7bd61fe0db4d0f..3ffe2331b9ae5c 100644
--- a/clang/test/Analysis/loop-widening-notes.cpp
+++ b/clang/test/Analysis/loop-widening-notes.cpp
@@ -7,8 +7,8 @@ int test_for_bug_25609() {
if (p_a == 0) // expected-note {{Assuming 'p_a' is equal to null}}
// expected-note at -1 {{Taking true branch}}
bar();
- for (int i = 0; // expected-note {{Loop condition is true. Entering loop body}}
- // expected-note at -1 {{Loop condition is false. Execution continues on line 16}}
+ for (int i = 0; // expected-note {{Loop condition is true; entering loop body}}
+ // expected-note at -1 {{Loop condition is false; execution continues on line 16}}
++i, // expected-note {{Value assigned to 'p_a'}}
i < flag_a;
++i) {}
@@ -22,9 +22,9 @@ int flag_b;
int while_analyzer_output() {
flag_b = 100;
int num = 10;
- while (flag_b-- > 0) { // expected-note {{Loop condition is true. Entering loop body}}
+ while (flag_b-- > 0) { // expected-note {{Loop condition is true; entering loop body}}
// expected-note at -1 {{Value assigned to 'num'}}
- // expected-note at -2 {{Loop condition is false. Execution continues on line 30}}
+ // expected-note at -2 {{Loop condition is false; execution continues on line 30}}
num = flag_b;
}
if (num < 0) // expected-note {{Assuming 'num' is >= 0}}
@@ -42,8 +42,8 @@ int while_analyzer_output() {
int flag_c;
int do_while_analyzer_output() {
int num = 10;
- do { // expected-note {{Loop condition is true. Execution continues on line 47}}
- // expected-note at -1 {{Loop condition is false. Exiting loop}}
+ do { // expected-note {{Loop condition is true; execution continues on line 47}}
+ // expected-note at -1 {{Loop condition is false; exiting loop}}
num--;
} while (flag_c-- > 0); //expected-note {{Value assigned to 'num'}}
int local = 0;
@@ -57,8 +57,8 @@ int do_while_analyzer_output() {
int flag_d;
int test_for_loop() {
int num = 10;
- for (int i = 0; // expected-note {{Loop condition is true. Entering loop body}}
- // expected-note at -1 {{Loop condition is false. Execution continues on line 67}}
+ for (int i = 0; // expected-note {{Loop condition is true; entering loop body}}
+ // expected-note at -1 {{Loop condition is false; execution continues on line 67}}
new int(10), // expected-note {{Value assigned to 'num'}}
i < flag_d;
++i) {
diff --git a/clang/test/Analysis/loop-widening.cpp b/clang/test/Analysis/loop-widening.cpp
index fa8e9c2f3d6968..6b56110292cc10 100644
--- a/clang/test/Analysis/loop-widening.cpp
+++ b/clang/test/Analysis/loop-widening.cpp
@@ -14,8 +14,8 @@ void fn1() {
A a;
A *b = &a;
- for (;;) { // expected-note{{Loop condition is true. Entering loop body}}
- // expected-note at -1{{Loop condition is true. Entering loop body}}
+ for (;;) { // expected-note{{Loop condition is true; entering loop body}}
+ // expected-note at -1{{Loop condition is true; entering loop body}}
// expected-note at -2{{Value assigned to 'b'}}
// no crash during bug report construction
diff --git a/clang/test/Analysis/mig.mm b/clang/test/Analysis/mig.mm
index 954eccc1a01ca6..07f557a8e23a7a 100644
--- a/clang/test/Analysis/mig.mm
+++ b/clang/test/Analysis/mig.mm
@@ -80,8 +80,8 @@ kern_return_t basic_test(mach_port_name_t port, vm_address_t address, vm_size_t
vm_deallocate(port, address, size); // expected-note{{Value passed through parameter 'address' is deallocated}}
if (size > 10) { // expected-note{{Assuming 'size' is > 10}}
// expected-note at -1{{Taking true branch}}
- return KERN_ERROR; // expected-warning{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
- // expected-note at -1{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ return KERN_ERROR; // expected-warning{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ // expected-note at -1{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
}
return KERN_SUCCESS;
}
@@ -109,8 +109,8 @@ kern_return_t release_twice(mach_port_name_t port, vm_address_t addr1, vm_addres
kern_return_t ret = KERN_ERROR; // expected-note{{'ret' initialized to 1}}
vm_deallocate(port, addr1, size); // expected-note{{Value passed through parameter 'addr1' is deallocated}}
vm_deallocate(port, addr2, size); // expected-note{{Value passed through parameter 'addr2' is deallocated}}
- return ret; // expected-warning{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
- // expected-note at -1{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ return ret; // expected-warning{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ // expected-note at -1{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
}
MIG_SERVER_ROUTINE
@@ -140,8 +140,8 @@ kern_return_t test_vm_deallocate_in_automatic_dtor(mach_port_name_t port, vm_add
return KERN_ERROR;
// expected-note at -1{{Calling '~WillDeallocate'}}
// expected-note at -2{{Returning from '~WillDeallocate'}}
- // expected-warning at -3{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
- // expected-note at -4 {{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ // expected-warning at -3{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ // expected-note at -4 {{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
}
return KERN_SUCCESS;
}
@@ -156,8 +156,8 @@ - (kern_return_t)fooAtPort:(mach_port_name_t)port
withAddress:(vm_address_t)address
ofSize:(vm_size_t)size MIG_SERVER_ROUTINE {
vm_deallocate(port, address, size); // expected-note{{Value passed through parameter 'address' is deallocated}}
- return KERN_ERROR; // expected-warning{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
- // expected-note at -1{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ return KERN_ERROR; // expected-warning{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ // expected-note at -1{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
}
@end
@@ -166,8 +166,8 @@ void test_block() {
^MIG_SERVER_ROUTINE (mach_port_name_t port,
vm_address_t address, vm_size_t size) {
vm_deallocate(port, address, size); // expected-note{{Value passed through parameter 'address' is deallocated}}
- return KERN_ERROR; // expected-warning{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
- // expected-note at -1{{MIG callback fails with error after deallocating argument value. This is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ return KERN_ERROR; // expected-warning{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
+ // expected-note at -1{{MIG callback fails with error after deallocating argument value; this is a use-after-free vulnerability because the caller will try to deallocate it again}}
};
}
diff --git a/clang/test/Analysis/mmap-writeexec.c b/clang/test/Analysis/mmap-writeexec.c
index bca34d167fbc92..c8a6003da41339 100644
--- a/clang/test/Analysis/mmap-writeexec.c
+++ b/clang/test/Analysis/mmap-writeexec.c
@@ -23,7 +23,7 @@ void f1(void)
{
void *a = mmap(NULL, 16, PROT_READ | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0); // no-warning
void *b = mmap(a, 16, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED | MAP_ANON, -1, 0); // no-warning
- void *c = mmap(NULL, 32, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0); // expected-warning{{Both PROT_WRITE and PROT_EXEC flags are set. This can lead to exploitable memory regions, which could be overwritten with malicious code}}
+ void *c = mmap(NULL, 32, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0); // expected-warning{{Both PROT_WRITE and PROT_EXEC flags are set; this can lead to exploitable memory regions, which could be overwritten with malicious code}}
(void)a;
(void)b;
(void)c;
@@ -34,13 +34,13 @@ void f2(void)
void *(*callm)(void *, size_t, int, int, int, long);
callm = mmap;
int prot = PROT_WRITE | PROT_EXEC;
- (void)callm(NULL, 1024, prot, MAP_PRIVATE | MAP_ANON, -1, 0); // expected-warning{{Both PROT_WRITE and PROT_EXEC flags are set. This can lead to exploitable memory regions, which could be overwritten with malicious code}}
+ (void)callm(NULL, 1024, prot, MAP_PRIVATE | MAP_ANON, -1, 0); // expected-warning{{Both PROT_WRITE and PROT_EXEC flags are set; this can lead to exploitable memory regions, which could be overwritten with malicious code}}
}
void f3(void)
{
void *p = mmap(NULL, 1024, PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); // no-warning
- int m = mprotect(p, 1024, PROT_WRITE | PROT_EXEC); // expected-warning{{Both PROT_WRITE and PROT_EXEC flags are set. This can lead to exploitable memory regions, which could be overwritten with malicious code}}
+ int m = mprotect(p, 1024, PROT_WRITE | PROT_EXEC); // expected-warning{{Both PROT_WRITE and PROT_EXEC flags are set; this can lead to exploitable memory regions, which could be overwritten with malicious code}}
(void)m;
}
diff --git a/clang/test/Analysis/padding_message.cpp b/clang/test/Analysis/padding_message.cpp
index e8b9f4022a775d..39c1427087b0e1 100644
--- a/clang/test/Analysis/padding_message.cpp
+++ b/clang/test/Analysis/padding_message.cpp
@@ -1,8 +1,8 @@
// RUN: %clang_analyze_cc1 -triple x86_64-unknown-linux -std=c++14 -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=2 -verify %s
// expected-warning at +7{{\
-Excessive padding in 'struct IntSandwich' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct IntSandwich' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
i, \
c1, \
c2, \
@@ -14,8 +14,8 @@ struct IntSandwich {
};
// expected-warning at +7{{\
-Excessive padding in 'struct TurDuckHen' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct TurDuckHen' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
i, \
c1, \
c2, \
@@ -29,8 +29,8 @@ struct TurDuckHen {
#pragma pack(push)
#pragma pack(2)
// expected-warning at +11{{\
-Excessive padding in 'struct SmallIntSandwich' (4 padding bytes, where 0 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct SmallIntSandwich' (4 padding bytes, where 0 is optimal); \
+optimal fields order: \
i1, \
i2, \
i3, \
@@ -57,8 +57,8 @@ union SomeUnion { // no-warning
};
// expected-warning at +7{{\
-Excessive padding in 'struct HoldsAUnion' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct HoldsAUnion' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
u, \
c1, \
c2, \
@@ -78,8 +78,8 @@ struct MediumIntArray { // no-warning
};
// expected-warning at +7{{\
-Excessive padding in 'struct StructSandwich' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct StructSandwich' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
m, \
s, \
s2, \
@@ -91,8 +91,8 @@ struct StructSandwich {
};
// expected-warning at +7{{\
-Excessive padding in 'TypedefSandwich' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'TypedefSandwich' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
i, \
c1, \
c2, \
@@ -104,8 +104,8 @@ typedef struct {
} TypedefSandwich;
// expected-warning at +7{{\
-Excessive padding in 'struct StructAttrAlign' (10 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct StructAttrAlign' (10 padding bytes, where 2 is optimal); \
+optimal fields order: \
i, \
c1, \
c2, \
@@ -117,8 +117,8 @@ struct StructAttrAlign {
} __attribute__((aligned(8)));
// expected-warning at +8{{\
-Excessive padding in 'struct OverlyAlignedChar' (8185 padding bytes, where 4089 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct OverlyAlignedChar' (8185 padding bytes, where 4089 is optimal); \
+optimal fields order: \
c, \
c1, \
c2, \
@@ -132,8 +132,8 @@ struct OverlyAlignedChar {
};
// expected-warning at +7{{\
-Excessive padding in 'struct HoldsOverlyAlignedChar' (8190 padding bytes, where 4094 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct HoldsOverlyAlignedChar' (8190 padding bytes, where 4094 is optimal); \
+optimal fields order: \
o, \
c1, \
c2, \
@@ -146,8 +146,8 @@ struct HoldsOverlyAlignedChar {
void internalStructFunc() {
// expected-warning at +7{{\
-Excessive padding in 'struct X' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct X' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
t, \
c1, \
c2, \
@@ -162,8 +162,8 @@ c2, \
void typedefStructFunc() {
// expected-warning at +7{{\
-Excessive padding in 'S' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'S' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
t, \
c1, \
c2, \
@@ -177,8 +177,8 @@ c2, \
}
// expected-warning at +7{{\
-Excessive padding in 'struct DefaultAttrAlign' (22 padding bytes, where 6 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct DefaultAttrAlign' (22 padding bytes, where 6 is optimal); \
+optimal fields order: \
i, \
c1, \
c2, \
@@ -190,8 +190,8 @@ struct DefaultAttrAlign {
} __attribute__((aligned));
// expected-warning at +7{{\
-Excessive padding in 'struct SmallArrayShortSandwich' (2 padding bytes, where 0 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct SmallArrayShortSandwich' (2 padding bytes, where 0 is optimal); \
+optimal fields order: \
s, \
c1, \
c2, \
@@ -203,8 +203,8 @@ struct SmallArrayShortSandwich {
} ShortArray[20];
// expected-warning at +7{{\
-Excessive padding in 'struct SmallArrayInFunc' (2 padding bytes, where 0 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct SmallArrayInFunc' (2 padding bytes, where 0 is optimal); \
+optimal fields order: \
s, \
c1, \
c2, \
@@ -220,8 +220,8 @@ void arrayHolder() {
}
// expected-warning at +7{{\
-Excessive padding in 'class VirtualIntSandwich' (10 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'class VirtualIntSandwich' (10 padding bytes, where 2 is optimal); \
+optimal fields order: \
i, \
c1, \
c2, \
@@ -235,8 +235,8 @@ class VirtualIntSandwich {
// constructed so as not to have tail padding
// expected-warning at +8{{\
-Excessive padding in 'class InnerPaddedB' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'class InnerPaddedB' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
i1, \
i2, \
c1, \
@@ -252,8 +252,8 @@ class InnerPaddedB {
class Empty {}; // no-warning
// expected-warning at +7{{\
-Excessive padding in 'class LotsOfSpace' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'class LotsOfSpace' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
i, \
e1, \
e2, \
@@ -265,8 +265,8 @@ class LotsOfSpace {
};
// expected-warning at +7{{\
-Excessive padding in 'struct TypedefSandwich2' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct TypedefSandwich2' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
t, \
c1, \
c2, \
@@ -274,8 +274,8 @@ c2, \
typedef struct TypedefSandwich2 {
char c1;
// expected-warning at +7{{\
-Excessive padding in 'TypedefSandwich2::NestedTypedef' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'TypedefSandwich2::NestedTypedef' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
i, \
c1, \
c2, \
@@ -292,8 +292,8 @@ c2, \
template <typename T>
struct Foo {
// expected-warning at +7{{\
-Excessive padding in 'struct Foo<int>::Nested' (6 padding bytes, where 2 is optimal). \
-Optimal fields order: \
+Excessive padding in 'struct Foo<int>::Nested' (6 padding bytes, where 2 is optimal); \
+optimal fields order: \
t, \
c1, \
c2, \
diff --git a/clang/test/Analysis/pthreadlock.c b/clang/test/Analysis/pthreadlock.c
index e235628799a5e7..7ef20341c90fca 100644
--- a/clang/test/Analysis/pthreadlock.c
+++ b/clang/test/Analysis/pthreadlock.c
@@ -292,7 +292,7 @@ bad3(void)
{
pthread_mutex_lock(&mtx1); // no-warning
pthread_mutex_lock(&mtx2); // no-warning
- pthread_mutex_unlock(&mtx1); // lor-warning{{This was not the most recently acquired lock. Possible lock order reversal}}
+ pthread_mutex_unlock(&mtx1); // lor-warning{{This was not the most recently acquired lock; possible lock order reversal}}
pthread_mutex_unlock(&mtx2); // no-warning
}
@@ -302,7 +302,7 @@ bad4(void)
if (pthread_mutex_trylock(&mtx1)) // no-warning
return;
pthread_mutex_lock(&mtx2); // no-warning
- pthread_mutex_unlock(&mtx1); // lor-warning{{This was not the most recently acquired lock. Possible lock order reversal}}
+ pthread_mutex_unlock(&mtx1); // lor-warning{{This was not the most recently acquired lock; possible lock order reversal}}
}
void
@@ -326,7 +326,7 @@ bad7(void)
{
lck_mtx_lock(&lck1); // no-warning
lck_mtx_lock(&lck2); // no-warning
- lck_mtx_unlock(&lck1); // lor-warning{{This was not the most recently acquired lock. Possible lock order reversal}}
+ lck_mtx_unlock(&lck1); // lor-warning{{This was not the most recently acquired lock; possible lock order reversal}}
lck_mtx_unlock(&lck2); // no-warning
}
@@ -336,7 +336,7 @@ bad8(void)
if (lck_mtx_try_lock(&lck1) == 0) // no-warning
return;
lck_mtx_lock(&lck2); // no-warning
- lck_mtx_unlock(&lck1); // lor-warning{{This was not the most recently acquired lock. Possible lock order reversal}}
+ lck_mtx_unlock(&lck1); // lor-warning{{This was not the most recently acquired lock; possible lock order reversal}}
}
void
@@ -555,7 +555,7 @@ void ok_non_lifo_unlock_three(void) {
pthread_mutex_lock(&mtx1); // no-warning
pthread_mutex_lock(&mtx2); // no-warning
pthread_mutex_lock(&mtx3); // no-warning
- pthread_mutex_unlock(&mtx2); // lor-warning{{This was not the most recently acquired lock. Possible lock order reversal}}
+ pthread_mutex_unlock(&mtx2); // lor-warning{{This was not the most recently acquired lock; possible lock order reversal}}
pthread_mutex_unlock(&mtx3); // no-warning
pthread_mutex_unlock(&mtx1); // no-warning
}
diff --git a/clang/test/Analysis/return-ptr-range.cpp b/clang/test/Analysis/return-ptr-range.cpp
index 53612174897c75..a60bced521057b 100644
--- a/clang/test/Analysis/return-ptr-range.cpp
+++ b/clang/test/Analysis/return-ptr-range.cpp
@@ -8,7 +8,7 @@ int arr[10]; // expected-note{{Original object declared here}} expected-note{{Or
int *ptr;
int *test_global_ptr() {
- do { // expected-note{{Loop condition is false. Exiting loop}}
+ do { // expected-note{{Loop condition is false; exiting loop}}
int x = conjure_index();
ptr = arr + x; // expected-note{{Value assigned to 'ptr'}}
if (x != 20) // expected-note{{Assuming 'x' is equal to 20}}
@@ -22,7 +22,7 @@ int *test_global_ptr() {
int *test_local_ptr() {
int *local_ptr;
- do { // expected-note{{Loop condition is false. Exiting loop}}
+ do { // expected-note{{Loop condition is false; exiting loop}}
int x = conjure_index();
local_ptr = arr + x; // expected-note{{Value assigned to 'local_ptr'}}
if (x != 20) // expected-note{{Assuming 'x' is equal to 20}}
diff --git a/clang/test/Analysis/security-syntax-checks-nscoder.m b/clang/test/Analysis/security-syntax-checks-nscoder.m
index 23aa95bedccdca..2755c0cdc87e1d 100644
--- a/clang/test/Analysis/security-syntax-checks-nscoder.m
+++ b/clang/test/Analysis/security-syntax-checks-nscoder.m
@@ -31,6 +31,6 @@ void test(NSCoder *decoder) {
// This would be a vulnerability on 64-bit platforms
// but not on 32-bit platforms.
NSUInteger x;
- [decoder decodeValueOfObjCType:"I" at:&x]; // available-warning{{Deprecated method '-decodeValueOfObjCType:at:' is insecure as it can lead to potential buffer overflows. Use the safer '-decodeValueOfObjCType:at:size:' method}}
+ [decoder decodeValueOfObjCType:"I" at:&x]; // available-warning{{Deprecated method '-decodeValueOfObjCType:at:' is insecure as it can lead to potential buffer overflows; use the safer '-decodeValueOfObjCType:at:size:' method}}
[decoder decodeValueOfObjCType:"I" at:&x size:sizeof(x)]; // no-warning
}
diff --git a/clang/test/Analysis/security-syntax-checks.c b/clang/test/Analysis/security-syntax-checks.c
index 2c904f41623fcd..f57962b25388fa 100644
--- a/clang/test/Analysis/security-syntax-checks.c
+++ b/clang/test/Analysis/security-syntax-checks.c
@@ -18,11 +18,11 @@ void builtin_function_call_crash_fixes(char *c) {
__builtin_fprintf(fp, "%s", c);
#if __STDC_VERSION__ > 199901
- // expected-warning at -7{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
- // expected-warning at -7{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}}
- // expected-warning at -7{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
- // expected-warning at -7{{Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard.}}
- // expected-warning at -7{{Call to function 'fprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard.}}
+ // expected-warning at -7{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard}}
+ // expected-warning at -7{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard}}
+ // expected-warning at -7{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard}}
+ // expected-warning at -7{{Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard}}
+ // expected-warning at -7{{Call to function 'fprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard}}
#else
// expected-no-diagnostics
#endif
diff --git a/clang/test/Analysis/security-syntax-checks.m b/clang/test/Analysis/security-syntax-checks.m
index e4699541dff63c..f9c45f52c83786 100644
--- a/clang/test/Analysis/security-syntax-checks.m
+++ b/clang/test/Analysis/security-syntax-checks.m
@@ -83,7 +83,7 @@ void test_gets(void) {
void test_getpw(void) {
char buff[1024];
- getpw(2, buff); // expected-warning{{The getpw() function is dangerous as it may overflow the provided buffer. It is obsoleted by getpwuid()}}
+ getpw(2, buff); // expected-warning{{The getpw() function is dangerous as it may overflow the provided buffer; it is obsoleted by getpwuid()}}
}
// CWE-273: Failure to Check Whether Privileges Were Dropped Successfully
@@ -100,8 +100,8 @@ void test_getpw(void) {
void test_setuid(void)
{
- setuid(2); // expected-warning{{The return value from the call to 'setuid' is not checked. If an error occurs in 'setuid', the following code may execute with unexpected privileges}}
- setuid(0); // expected-warning{{The return value from the call to 'setuid' is not checked. If an error occurs in 'setuid', the following code may execute with unexpected privileges}}
+ setuid(2); // expected-warning{{The return value from the call to 'setuid' is not checked; if an error occurs in 'setuid', the following code may execute with unexpected privileges}}
+ setuid(0); // expected-warning{{The return value from the call to 'setuid' is not checked; if an error occurs in 'setuid', the following code may execute with unexpected privileges}}
if (setuid (2) != 0)
abort();
@@ -113,8 +113,8 @@ void test_setuid(void)
check(setuid (2)); // no-warning
- setreuid(2,2); // expected-warning{{The return value from the call to 'setreuid' is not checked. If an error occurs in 'setreuid', the following code may execute with unexpected privileges}}
- setregid(2,2); // expected-warning{{The return value from the call to 'setregid' is not checked. If an error occurs in 'setregid', the following code may execute with unexpected privileges}}
+ setreuid(2,2); // expected-warning{{The return value from the call to 'setreuid' is not checked; if an error occurs in 'setreuid', the following code may execute with unexpected privileges}}
+ setregid(2,2); // expected-warning{{The return value from the call to 'setregid' is not checked; if an error occurs in 'setregid', the following code may execute with unexpected privileges}}
}
// CWE-338: Use of cryptographically weak prng
@@ -135,16 +135,16 @@ void test_rand(void)
unsigned short a[7];
unsigned b;
- rand(); // expected-warning{{Function 'rand' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- drand48(); // expected-warning{{Function 'drand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- erand48(a); // expected-warning{{Function 'erand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- jrand48(a); // expected-warning{{Function 'jrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- lcong48(a); // expected-warning{{Function 'lcong48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- lrand48(); // expected-warning{{Function 'lrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- mrand48(); // expected-warning{{Function 'mrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- nrand48(a); // expected-warning{{Function 'nrand48' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- rand_r(&b); // expected-warning{{Function 'rand_r' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}}
- random(); // expected-warning{{The 'random' function produces a sequence of values that an adversary may be able to predict. Use 'arc4random' instead}}
+ rand(); // expected-warning{{Function 'rand' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ drand48(); // expected-warning{{Function 'drand48' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ erand48(a); // expected-warning{{Function 'erand48' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ jrand48(a); // expected-warning{{Function 'jrand48' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ lcong48(a); // expected-warning{{Function 'lcong48' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ lrand48(); // expected-warning{{Function 'lrand48' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ mrand48(); // expected-warning{{Function 'mrand48' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ nrand48(a); // expected-warning{{Function 'nrand48' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ rand_r(&b); // expected-warning{{Function 'rand_r' is obsolete because it implements a poor random number generator; use 'arc4random' instead}}
+ random(); // expected-warning{{The 'random' function produces a sequence of values that an adversary may be able to predict; use 'arc4random' instead}}
}
char *mktemp(char *buf);
@@ -175,12 +175,12 @@ void test_strcpy(void) {
char x[4];
char *y;
- strcpy(x, y); //expected-warning{{Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119}}
+ strcpy(x, y); //expected-warning{{Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer; replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'; CWE-119}}
}
void test_strcpy_2(void) {
char x[4];
- strcpy(x, "abcd"); //expected-warning{{Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119}}
+ strcpy(x, "abcd"); //expected-warning{{Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer; replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'; CWE-119}}
}
void test_strcpy_safe(void) {
@@ -214,7 +214,7 @@ void test_strcat(void) {
char x[4];
char *y;
- strcat(x, y); //expected-warning{{Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119}}
+ strcat(x, y); //expected-warning{{Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer; replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'; CWE-119}}
}
//===----------------------------------------------------------------------===
diff --git a/clang/test/Analysis/stack-addr-ps.cpp b/clang/test/Analysis/stack-addr-ps.cpp
index 3a14ce0ca55de5..5d3465f73bf6dd 100644
--- a/clang/test/Analysis/stack-addr-ps.cpp
+++ b/clang/test/Analysis/stack-addr-ps.cpp
@@ -373,7 +373,7 @@ void ***param_ptr_to_ptr_to_ptr_return(void ***ppp) {
int local = 0;
**ppp = &local;
return ppp;
- // expected-warning at -1 {{Address of stack memory associated with local variable 'local' is still referred to by the caller variable 'ppp' upon returning to the caller. This will be a dangling reference}}
+ // expected-warning at -1 {{Address of stack memory associated with local variable 'local' is still referred to by the caller variable 'ppp' upon returning to the caller; this will be a dangling reference}}
}
void param_ptr_to_ptr_to_ptr_caller(void** pp) {
@@ -568,7 +568,7 @@ S returned_struct_with_ptr_callee() {
int local = 42;
S s;
s.p = &local;
- return s; // expected-warning {{Address of stack memory associated with local variable 'local' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'local' is still referred to by the caller variable 's' upon returning to the caller. This will be a dangling reference}}
+ return s; // expected-warning {{Address of stack memory associated with local variable 'local' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'local' is still referred to by the caller variable 's' upon returning to the caller; this will be a dangling reference}}
}
S leak_through_field_of_returned_object() {
diff --git a/clang/test/Analysis/stack-capture-leak-no-arc.mm b/clang/test/Analysis/stack-capture-leak-no-arc.mm
index 03b3811be38327..2e9f0da73f17e2 100644
--- a/clang/test/Analysis/stack-capture-leak-no-arc.mm
+++ b/clang/test/Analysis/stack-capture-leak-no-arc.mm
@@ -40,7 +40,7 @@ dispatch_block_t test_block_inside_block_async_leak() {
// called.
void output_block(dispatch_block_t * blk) {
int x = 0;
- *blk = ^{ f(x); }; // expected-warning {{Address of stack-allocated block declared on line 43 is still referred to by the caller variable 'blk' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
+ *blk = ^{ f(x); }; // expected-warning {{Address of stack-allocated block declared on line 43 is still referred to by the caller variable 'blk' upon returning to the caller; this will be a dangling reference [core.StackAddressEscape]}}
}
// The block literal captures nothing thus is treated as a constant.
@@ -54,7 +54,7 @@ void test_block_leak() {
__block dispatch_block_t blk;
int x = 0;
dispatch_block_t p = ^{
- blk = ^{ // expected-warning {{Address of stack-allocated block declared on line 57 is still referred to by the caller variable 'blk' upon returning to the caller. This will be a dangling reference [core.StackAddressEscape]}}
+ blk = ^{ // expected-warning {{Address of stack-allocated block declared on line 57 is still referred to by the caller variable 'blk' upon returning to the caller; this will be a dangling reference [core.StackAddressEscape]}}
f(x);
};
};
diff --git a/clang/test/Analysis/stackaddrleak.c b/clang/test/Analysis/stackaddrleak.c
index 1ec129333a7fec..615394a62bc934 100644
--- a/clang/test/Analysis/stackaddrleak.c
+++ b/clang/test/Analysis/stackaddrleak.c
@@ -7,7 +7,7 @@ char const *p;
void f0(void) {
char const str[] = "This will change";
p = str;
-} // expected-warning at -1{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
+} // expected-warning at -1{{Address of stack memory associated with local variable 'str' is still referred to by the global variable 'p' upon returning to the caller; this will be a dangling reference}}
void f1(void) {
char const str[] = "This will change";
@@ -17,7 +17,7 @@ void f1(void) {
void f2(void) {
p = (const char *) __builtin_alloca(12);
-} // expected-warning at -1{{Address of stack memory allocated by call to alloca() on line 19 is still referred to by the global variable 'p' upon returning to the caller. This will be a dangling reference}}
+} // expected-warning at -1{{Address of stack memory allocated by call to alloca() on line 19 is still referred to by the global variable 'p' upon returning to the caller; this will be a dangling reference}}
// PR 7383 - previously the stack address checker would crash on this example
// because it would attempt to do a direct load from 'pr7383_list'.
diff --git a/clang/test/Analysis/stackaddrleak.cpp b/clang/test/Analysis/stackaddrleak.cpp
index 74120fd9fdd4e8..5b5a04da613146 100644
--- a/clang/test/Analysis/stackaddrleak.cpp
+++ b/clang/test/Analysis/stackaddrleak.cpp
@@ -18,7 +18,7 @@ struct myfunction {
myfunction create_func() {
int n;
auto c = [&n] {};
- return c; // expected-warning {{Address of stack memory associated with local variable 'n' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'n' is still referred to by a temporary object on the stack upon returning to the caller. This will be a dangling reference}}
+ return c; // expected-warning {{Address of stack memory associated with local variable 'n' returned to caller}} expected-warning{{Address of stack memory associated with local variable 'n' is still referred to by a temporary object on the stack upon returning to the caller; this will be a dangling reference}}
}
void gh_66221() {
create_func()();
diff --git a/clang/test/Analysis/std-c-library-functions-arg-constraints-notes.cpp b/clang/test/Analysis/std-c-library-functions-arg-constraints-notes.cpp
index f30f977bcd1dd1..d95bc92c992aab 100644
--- a/clang/test/Analysis/std-c-library-functions-arg-constraints-notes.cpp
+++ b/clang/test/Analysis/std-c-library-functions-arg-constraints-notes.cpp
@@ -202,7 +202,7 @@ void test_explanation(int x, int y) {
return;
case 4:
if (x != 0)
- __single_val_0(x); // expected-warning{{is out of the accepted range; It should be zero [}}
+ __single_val_0(x); // expected-warning{{is out of the accepted range; it should be zero [}}
return;
case 5:
if (x == 3)
@@ -230,7 +230,7 @@ void test_explanation(int x, int y) {
return;
case 11:
if (__test_case_range_1_2__4_6(x) == 4)
- __range_1_2__4_6(x); // expected-warning{{is out of the accepted range; It should be 1 or 2 or between 4 and 6 [}}
+ __range_1_2__4_6(x); // expected-warning{{is out of the accepted range; it should be 1 or 2 or between 4 and 6 [}}
return;
}
}
diff --git a/clang/test/Analysis/stream-note.c b/clang/test/Analysis/stream-note.c
index 2b5d1edb2814f0..b3e124258f3f72 100644
--- a/clang/test/Analysis/stream-note.c
+++ b/clang/test/Analysis/stream-note.c
@@ -25,8 +25,8 @@ void check_note_at_correct_open(void) {
fclose(F2);
rewind(F1);
}
-// expected-warning at -1 {{Opened stream never closed. Potential resource leak}}
-// expected-note at -2 {{Opened stream never closed. Potential resource leak}}
+// expected-warning at -1 {{Opened stream never closed; potential resource leak}}
+// expected-note at -2 {{Opened stream never closed; potential resource leak}}
void check_note_fopen(void) {
FILE *F = fopen("file", "r"); // expected-note {{Stream opened here}}
@@ -36,8 +36,8 @@ void check_note_fopen(void) {
// expected-note at -2 {{Taking false branch}}
return;
}
-// expected-warning at -1 {{Opened stream never closed. Potential resource leak}}
-// expected-note at -2 {{Opened stream never closed. Potential resource leak}}
+// expected-warning at -1 {{Opened stream never closed; potential resource leak}}
+// expected-note at -2 {{Opened stream never closed; potential resource leak}}
void check_note_freopen(void) {
FILE *F = fopen("file", "r"); // expected-note {{Stream opened here}}
@@ -53,8 +53,8 @@ void check_note_freopen(void) {
// expected-note at -2 {{Taking false branch}}
return;
}
-// expected-warning at -1 {{Opened stream never closed. Potential resource leak}}
-// expected-note at -2 {{Opened stream never closed. Potential resource leak}}
+// expected-warning at -1 {{Opened stream never closed; potential resource leak}}
+// expected-note at -2 {{Opened stream never closed; potential resource leak}}
void check_note_fdopen(int fd) {
FILE *F = fdopen(fd, "r"); // expected-note {{Stream opened here}}
@@ -64,8 +64,8 @@ void check_note_fdopen(int fd) {
// expected-note at -2 {{Taking false branch}}
return;
}
-// expected-warning at -1 {{Opened stream never closed. Potential resource leak}}
-// expected-note at -2 {{Opened stream never closed. Potential resource leak}}
+// expected-warning at -1 {{Opened stream never closed; potential resource leak}}
+// expected-note at -2 {{Opened stream never closed; potential resource leak}}
void check_note_leak_2(int c) {
FILE *F1 = fopen("foo1.c", "r"); // expected-note {{Stream opened here}}
@@ -92,10 +92,10 @@ void check_note_leak_2(int c) {
// expected-note at -3 {{Assuming 'c' is not equal to 0}}
// expected-note at -4 {{Taking true branch}}
return;
- // expected-warning at -1 {{Opened stream never closed. Potential resource leak}}
- // expected-note at -2 {{Opened stream never closed. Potential resource leak}}
- // expected-warning at -3 {{Opened stream never closed. Potential resource leak}}
- // expected-note at -4 {{Opened stream never closed. Potential resource leak}}
+ // expected-warning at -1 {{Opened stream never closed; potential resource leak}}
+ // expected-note at -2 {{Opened stream never closed; potential resource leak}}
+ // expected-warning at -3 {{Opened stream never closed; potential resource leak}}
+ // expected-note at -4 {{Opened stream never closed; potential resource leak}}
fclose(F1);
fclose(F2);
}
@@ -124,8 +124,8 @@ void check_eof_notes_feof_after_feof(void) {
clearerr(F);
fread(Buf, 1, 1, F); // expected-note {{Assuming stream reaches end-of-file here}}
if (feof(F)) { // expected-note {{Taking true branch}}
- fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state. Function has no effect}}
- // expected-note at -1 {{Read function called when stream is in EOF state. Function has no effect}}
+ fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state; function has no effect}}
+ // expected-note at -1 {{Read function called when stream is in EOF state; function has no effect}}
}
}
fclose(F);
@@ -148,8 +148,8 @@ void check_eof_notes_feof_after_no_feof(void) {
}
fread(Buf, 1, 1, F); // expected-note {{Assuming stream reaches end-of-file here}}
if (feof(F)) { // expected-note {{Taking true branch}}
- fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state. Function has no effect}}
- // expected-note at -1 {{Read function called when stream is in EOF state. Function has no effect}}
+ fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state; function has no effect}}
+ // expected-note at -1 {{Read function called when stream is in EOF state; function has no effect}}
}
fclose(F);
}
@@ -163,8 +163,8 @@ void check_eof_notes_feof_or_no_error(void) {
int RRet = fread(Buf, 1, 1, F); // expected-note {{Assuming stream reaches end-of-file here}}
if (ferror(F)) { // expected-note {{Taking false branch}}
} else {
- fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state. Function has no effect}}
- // expected-note at -1 {{Read function called when stream is in EOF state. Function has no effect}}
+ fread(Buf, 1, 1, F); // expected-warning {{Read function called when stream is in EOF state; function has no effect}}
+ // expected-note at -1 {{Read function called when stream is in EOF state; function has no effect}}
}
fclose(F);
}
@@ -180,8 +180,8 @@ void check_indeterminate_notes(void) {
// expected-note {{'R' is >= 0}}
fgetc(F); // expected-note {{Assuming this stream operation fails}}
if (ferror(F)) // expected-note {{Taking true branch}}
- fgetc(F); // expected-warning {{File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior}} \
- // expected-note {{File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior}}
+ fgetc(F); // expected-warning {{File position of the stream might be 'indeterminate' after a failed operation; can cause undefined behavior}} \
+ // expected-note {{File position of the stream might be 'indeterminate' after a failed operation; can cause undefined behavior}}
}
fclose(F);
}
diff --git a/clang/test/Analysis/stream-notes-missing-close.cpp b/clang/test/Analysis/stream-notes-missing-close.cpp
index 272ca96c76ee18..6bfaccb14f24aa 100644
--- a/clang/test/Analysis/stream-notes-missing-close.cpp
+++ b/clang/test/Analysis/stream-notes-missing-close.cpp
@@ -28,8 +28,8 @@ void sink(FILE *f) {
void f() {
sink(fopen("input.txt", "w"));
// expected-note at -1{{Stream opened here}}
-} // expected-warning{{Opened stream never closed. Potential resource leak [unix.Stream]}}
-// expected-note at -1{{Opened stream never closed. Potential resource leak}}
+} // expected-warning{{Opened stream never closed; potential resource leak [unix.Stream]}}
+// expected-note at -1{{Opened stream never closed; potential resource leak}}
} // namespace stream_opened_in_fn_call
namespace stream_passed_to_fn_call {
@@ -52,8 +52,8 @@ void f() {
expectedClose(f); // expected-note{{Calling 'expectedClose'}}
// expected-note at -1{{Returning from 'expectedClose'}}
- return; // expected-warning{{Opened stream never closed. Potential resource leak [unix.Stream]}}
- // expected-note at -1{{Opened stream never closed. Potential resource leak}}
+ return; // expected-warning{{Opened stream never closed; potential resource leak [unix.Stream]}}
+ // expected-note at -1{{Opened stream never closed; potential resource leak}}
}
fclose(f);
}
@@ -76,8 +76,8 @@ void foo() {
return;
sink(f); // expected-note {{Calling 'sink'}}
// expected-note at -1 {{Returning from 'sink'}}
-} // expected-warning{{Opened stream never closed. Potential resource leak [unix.Stream]}}
-// expected-note at -1{{Opened stream never closed. Potential resource leak}}
+} // expected-warning{{Opened stream never closed; potential resource leak [unix.Stream]}}
+// expected-note at -1{{Opened stream never closed; potential resource leak}}
} // namespace stream_shared_with_ptr_of_shorter_lifetime
@@ -100,8 +100,8 @@ void f(FILE *p) {
if (!f) // expected-note{{'f' is non-null}}
// expected-note at -1{{Taking false branch}}
return;
- expectedClose(p); // expected-warning{{Opened stream never closed. Potential resource leak [unix.Stream]}}
- // expected-note at -1{{Opened stream never closed. Potential resource leak}}
+ expectedClose(p); // expected-warning{{Opened stream never closed; potential resource leak [unix.Stream]}}
+ // expected-note at -1{{Opened stream never closed; potential resource leak}}
}
} // namespace stream_not_passed_to_fn_call
@@ -120,8 +120,8 @@ void f() {
// expected-note at -1{{Taking false branch}}
return;
expectedClose(f, &p);
-} // expected-warning{{Opened stream never closed. Potential resource leak [unix.Stream]}}
- // expected-note at -1{{Opened stream never closed. Potential resource leak}}
+} // expected-warning{{Opened stream never closed; potential resource leak [unix.Stream]}}
+ // expected-note at -1{{Opened stream never closed; potential resource leak}}
} // namespace stream_shared_with_ptr_of_same_lifetime
namespace stream_passed_into_fn_that_doesnt_intend_to_free {
@@ -135,8 +135,8 @@ void f() {
return;
expectedClose(f);
-} // expected-warning{{Opened stream never closed. Potential resource leak [unix.Stream]}}
- // expected-note at -1{{Opened stream never closed. Potential resource leak}}
+} // expected-warning{{Opened stream never closed; potential resource leak [unix.Stream]}}
+ // expected-note at -1{{Opened stream never closed; potential resource leak}}
} // namespace stream_passed_into_fn_that_doesnt_intend_to_free
namespace stream_passed_into_fn_that_doesnt_intend_to_free2 {
@@ -155,8 +155,8 @@ void f() {
return;
expectedClose(f);
-} // expected-warning{{Opened stream never closed. Potential resource leak [unix.Stream]}}
- // expected-note at -1{{Opened stream never closed. Potential resource leak}}
+} // expected-warning{{Opened stream never closed; potential resource leak [unix.Stream]}}
+ // expected-note at -1{{Opened stream never closed; potential resource leak}}
} // namespace stream_passed_into_fn_that_doesnt_intend_to_free2
namespace streamstate_from_closed_to_open {
@@ -173,7 +173,7 @@ void use_ret() {
v = fopenWrapper(); // expected-note {{Calling 'fopenWrapper'}}
// expected-note at -1{{Returning from 'fopenWrapper'}}
-} // expected-warning{{Opened stream never closed. Potential resource leak [unix.Stream]}}
- // expected-note at -1{{Opened stream never closed. Potential resource leak}}
+} // expected-warning{{Opened stream never closed; potential resource leak [unix.Stream]}}
+ // expected-note at -1{{Opened stream never closed; potential resource leak}}
} // namespace streamstate_from_closed_to_open
diff --git a/clang/test/Analysis/stream.c b/clang/test/Analysis/stream.c
index 10e6e5381ee6d1..5bc1f940524d04 100644
--- a/clang/test/Analysis/stream.c
+++ b/clang/test/Analysis/stream.c
@@ -233,7 +233,7 @@ void f_leak(int c) {
if (!p)
return;
if(c)
- return; // expected-warning {{Opened stream never closed. Potential resource leak}}
+ return; // expected-warning {{Opened stream never closed; potential resource leak}}
fclose(p);
}
@@ -345,7 +345,7 @@ void check_leak_noreturn_1(void) {
handle_error(); // no warning
}
rewind(F1);
-} // expected-warning {{Opened stream never closed. Potential resource leak}}
+} // expected-warning {{Opened stream never closed; potential resource leak}}
// Check that "location uniqueing" works.
// This results in reporting only one occurence of resource leak for a stream.
@@ -357,7 +357,7 @@ void check_leak_noreturn_2(void) {
return; // no warning
}
rewind(F1);
-} // expected-warning {{Opened stream never closed. Potential resource leak}}
+} // expected-warning {{Opened stream never closed; potential resource leak}}
// FIXME: This warning should be placed at the `return` above.
// See https://reviews.llvm.org/D83120 about details.
diff --git a/clang/test/Analysis/stream.cpp b/clang/test/Analysis/stream.cpp
index 8c65d9c287fdaf..a8957a931b48c4 100644
--- a/clang/test/Analysis/stream.cpp
+++ b/clang/test/Analysis/stream.cpp
@@ -19,4 +19,4 @@ void f1() {
void f2() {
FILE *f = fopen("file", "r");
-} // expected-warning {{Opened stream never closed. Potential resource leak}}
+} // expected-warning {{Opened stream never closed; potential resource leak}}
diff --git a/clang/test/Analysis/track-control-dependency-conditions.cpp b/clang/test/Analysis/track-control-dependency-conditions.cpp
index 76f9641729de5d..75bde938f0c795 100644
--- a/clang/test/Analysis/track-control-dependency-conditions.cpp
+++ b/clang/test/Analysis/track-control-dependency-conditions.cpp
@@ -858,7 +858,7 @@ void f(int flag) {
bar();
assert(cond1); // expected-note-re{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
// expected-note-re at -1{{{{^}}Taking false branch{{$}}}}
- // expected-note-re at -2{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+ // expected-note-re at -2{{{{^}}Loop condition is false; exiting loop{{$}}}}
if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
// expected-note-re at -1{{{{^}}Taking true branch{{$}}}}
@@ -902,7 +902,7 @@ void f(int flag) {
// expected-note-re at -2{{{{^}}Left side of '&&' is true{{$}}}}
// expected-note-re at -3{{{{^}}Assuming the condition is false{{$}}}}
// expected-note-re at -4{{{{^}}Taking false branch{{$}}}}
- // expected-note-re at -5{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+ // expected-note-re at -5{{{{^}}Loop condition is false; exiting loop{{$}}}}
if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
// expected-note-re at -1{{{{^}}Taking true branch{{$}}}}
@@ -945,7 +945,7 @@ void f(int flag) {
// expected-note-re at -1{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
// expected-note-re at -2{{{{^}}Left side of '||' is true{{$}}}}
// expected-note-re at -3{{{{^}}Taking false branch{{$}}}}
- // expected-note-re at -4{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+ // expected-note-re at -4{{{{^}}Loop condition is false; exiting loop{{$}}}}
if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
// expected-note-re at -1{{{{^}}Taking true branch{{$}}}}
diff --git a/clang/test/Analysis/use-after-move.cpp b/clang/test/Analysis/use-after-move.cpp
index a123c41c651e60..e01b52967ad5b0 100644
--- a/clang/test/Analysis/use-after-move.cpp
+++ b/clang/test/Analysis/use-after-move.cpp
@@ -297,78 +297,78 @@ void loopTest() {
{
A a;
// FIXME: Execution doesn't jump to the end of the function yet.
- for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}}
rightRefCall(std::move(a)); // no-warning
}
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
- // peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true; entering loop body}}
+ // peaceful-note at -2 {{Loop condition is false; execution jumps to the end of the function}}
rightRefCall(std::move(a)); // no-warning
}
}
{
A a;
- for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}}
leftRefCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
- // peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true; entering loop body}}
+ // peaceful-note at -2 {{Loop condition is false; execution jumps to the end of the function}}
leftRefCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}}
constCopyOrMoveCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
- // peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true; entering loop body}}
+ // peaceful-note at -2 {{Loop condition is false; execution jumps to the end of the function}}
constCopyOrMoveCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}}
moveInsideFunctionCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
- // peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true; entering loop body}}
+ // peaceful-note at -2 {{Loop condition is false; execution jumps to the end of the function}}
moveInsideFunctionCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}}
copyOrMoveCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
- // peaceful-note at -2 {{Loop condition is false. Execution jumps to the end of the function}}
+ for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true; entering loop body}}
+ // peaceful-note at -2 {{Loop condition is false; execution jumps to the end of the function}}
copyOrMoveCall(a); // no-warning
}
}
{
A a;
- for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is true. Entering loop body}}
- // peaceful-note at -1 {{Loop condition is true. Entering loop body}}
+ for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is true; entering loop body}}
+ // peaceful-note at -1 {{Loop condition is true; entering loop body}}
constCopyOrMoveCall(std::move(a)); // peaceful-note {{Object 'a' is moved}}
// peaceful-warning at -1 {{Moved-from object 'a' is moved}}
// peaceful-note at -2 {{Moved-from object 'a' is moved}}
@@ -580,7 +580,7 @@ void differentBranchesTest(int i) {
case 1:
b = std::move(a); // no-warning
// FIXME: Execution doesn't jump to the end of the function yet.
- break; // peaceful-note {{Execution jumps to the end of the function}}
+ break; // peaceful-note {{execution jumps to the end of the function}}
case 2:
a.foo(); // no-warning
break;
diff --git a/clang/test/Analysis/void-call-exit-modelling.c b/clang/test/Analysis/void-call-exit-modelling.c
index 6fc8cb54f00bcd..72a9a3c4148a9e 100644
--- a/clang/test/Analysis/void-call-exit-modelling.c
+++ b/clang/test/Analysis/void-call-exit-modelling.c
@@ -8,7 +8,7 @@ void inf_loop_break_callee() {
while (1) { // expected-note{{Loop condition is true}}
(void)data;
break; // No note that we jump to the line above from this break
- } // expected-note at -1{{Execution jumps to the end of the function}}
+ } // expected-note at -1{{execution jumps to the end of the function}}
} // expected-warning{{Potential leak of memory pointed to by 'data'}}
// expected-note at -1 {{Potential leak of memory pointed to by 'data'}}
@@ -21,6 +21,6 @@ void inf_loop_break_top() {
while (1) { // expected-note{{Loop condition is true}}
(void)data;
break; // No note that we jump to the line above from this break
- } // expected-note at -1{{Execution jumps to the end of the function}}
+ } // expected-note at -1{{execution jumps to the end of the function}}
} // expected-warning{{Potential leak of memory pointed to by 'data'}}
// expected-note at -1 {{Potential leak of memory pointed to by 'data'}}
More information about the cfe-commits
mailing list