[clang] [analyzer] Standardize diagnostic messages that contained multiple sentences (PR #237410)
Benedek Kaibas via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 30 14:46:02 PDT 2026
https://github.com/benedekaibas created https://github.com/llvm/llvm-project/pull/237410
None
>From 95f869065835cffc08cd00a084a1abd1d46ae6ff Mon Sep 17 00:00:00 2001
From: benedekaibas <kaibas01 at allegheny.edu>
Date: Fri, 30 Oct 2026 22:38:12 +0100
Subject: [PATCH] [analyzer] Standardize diagnostic messages that contained
multiple sentences
---
.../Checkers/CStringSyntaxChecker.cpp | 11 +--
.../Checkers/CheckSecuritySyntaxOnly.cpp | 23 +++---
.../Checkers/LocalizationChecker.cpp | 4 +-
.../StaticAnalyzer/Checkers/MIGChecker.cpp | 4 +-
.../StaticAnalyzer/Checkers/MallocChecker.cpp | 2 +-
.../Checkers/MmapWriteExecChecker.cpp | 2 +-
.../Checkers/NSErrorChecker.cpp | 2 +-
.../Checkers/PaddingChecker.cpp | 6 +-
.../Checkers/PthreadLockChecker.cpp | 2 +-
.../RetainCountDiagnostics.cpp | 12 +--
.../Checkers/StdLibraryFunctionsChecker.cpp | 4 +-
.../StaticAnalyzer/Checkers/StreamChecker.cpp | 18 ++---
.../WebKit/RetainPtrCtorAdoptChecker.cpp | 8 +-
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/edges-new.mm.plist | 24 +++---
.../Inputs/expected-plists/objc-arc.m.plist | 4 +-
.../objc-radar17039661.m.plist | 4 +-
.../retain-release-path-notes.m.plist | 20 ++---
.../retain-release.m.objc.plist | 76 +++++++++---------
.../retain-release.m.objcpp.plist | 76 +++++++++---------
clang/test/Analysis/c11lock.c | 2 +-
clang/test/Analysis/cstring-syntax.c | 18 ++---
clang/test/Analysis/fuchsia_lock.c | 4 +-
.../test/Analysis/incorrect-checker-names.mm | 4 +-
clang/test/Analysis/localization.m | 18 ++---
clang/test/Analysis/mig.mm | 20 ++---
clang/test/Analysis/mmap-writeexec.c | 6 +-
.../test/Analysis/osobject-retain-release.cpp | 20 ++---
clang/test/Analysis/padding_message.cpp | 80 +++++++++----------
clang/test/Analysis/pthreadlock.c | 10 +--
clang/test/Analysis/retain-release-arc.m | 4 +-
.../test/Analysis/retain-release-path-notes.m | 20 ++---
.../Analysis/security-syntax-checks-nscoder.m | 2 +-
clang/test/Analysis/security-syntax-checks.c | 10 +--
clang/test/Analysis/security-syntax-checks.m | 8 +-
...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 +-
.../test/Analysis/void-call-exit-modelling.c | 4 +-
44 files changed, 338 insertions(+), 338 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp
index bfd90beb82cdeb..1ba3d75d126df7 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp
@@ -226,13 +226,13 @@ void WalkAST::VisitCallExpr(CallExpr *CE) {
SmallString<256> S;
llvm::raw_svector_ostream os(S);
- os << "Potential buffer overflow. ";
+ os << "Potential buffer overflow; ";
if (!DstName.empty()) {
- os << "Replace with 'sizeof(" << DstName << ") "
+ os << "replace with 'sizeof(" << DstName << ") "
"- strlen(" << DstName <<") - 1'";
os << " or u";
} else
- os << "U";
+ os << "u";
os << "se a safer 'strlcat' API";
BR.EmitBasicReport(FD, Checker, "Anti-pattern in the argument",
@@ -251,8 +251,9 @@ void WalkAST::VisitCallExpr(CallExpr *CE) {
SmallString<256> S;
llvm::raw_svector_ostream os(S);
- os << "The third argument allows to potentially copy more bytes than it should. ";
- os << "Replace with the value ";
+ os << "The third argument allows to potentially copy more bytes than it "
+ "should; ";
+ os << "replace with the value ";
if (!DstName.empty())
os << "sizeof(" << DstName << ")";
else
diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
index 797e1efc7e8ca5..999dafa04e1db4 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());
}
@@ -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";
@@ -943,8 +942,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());
}
@@ -994,8 +993,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());
}
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/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..16dea487e04194 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/RetainCountChecker/RetainCountDiagnostics.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
index 59d11c4d8ae2cf..ea838db044c616 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
@@ -76,12 +76,12 @@ static bool shouldGenerateNote(llvm::raw_string_ostream &os,
}
if (PrevV.getCount() > CurrV.getCount())
- os << "Reference count decremented.";
+ os << "Reference count decremented";
else
- os << "Reference count incremented.";
+ os << "Reference count incremented";
if (unsigned Count = CurrV.getCount())
- os << " The object now has a +" << Count << " retain count.";
+ os << "; the object now has a +" << Count << " retain count";
return true;
@@ -89,9 +89,11 @@ static bool shouldGenerateNote(llvm::raw_string_ostream &os,
if (CurrV.getIvarAccessHistory() ==
RefVal::IvarAccessHistory::ReleasedAfterDirectAccess &&
CurrV.getIvarAccessHistory() != PrevV.getIvarAccessHistory()) {
- os << "Strong instance variable relinquished. ";
+ os << "Strong instance variable relinquished; o";
+ } else {
+ os << "O";
}
- os << "Object released.";
+ os << "bject released";
return true;
case RefVal::ReturnedOwned:
diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
index f6a6e535f7638b..e79870bfad14b7 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]);
@@ -1243,7 +1243,7 @@ ProgramStateRef StdLibraryFunctionsChecker::BufferSizeConstraint::apply(
return SVal(SvalBuilder.makeIntVal(*ConcreteSize));
}
assert(SizeArgN && "The constraint must be either a concrete value or "
- "encoded in an argument.");
+ "encoded in an argument");
// The size argument.
SVal SizeV = getArgSVal(Call, *SizeArgN);
// Multiply with another argument if given.
diff --git a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
index 92789eb462e74f..9427a7f1f01178 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
@@ -1829,7 +1829,7 @@ StreamChecker::ensureStreamNonNull(SVal StreamVal, const Expr *StreamE,
if (!StateNotNull && StateNull) {
if (ExplodedNode *N = C.generateErrorNode(StateNull)) {
auto R = std::make_unique<PathSensitiveBugReport>(
- BT_FileNull, "Stream pointer might be NULL.", N);
+ BT_FileNull, "Stream pointer might be NULL", N);
if (StreamE)
bugreporter::trackExpressionValue(N, StreamE, *R);
C.emitReport(std::move(R));
@@ -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)
@@ -1989,7 +1989,7 @@ StreamChecker::ensureFseekWhenceCorrect(SVal WhenceVal, CheckerContext &C,
C.emitReport(std::make_unique<PathSensitiveBugReport>(
BT_IllegalWhence,
"The whence argument to fseek() should be "
- "SEEK_SET, SEEK_END, or SEEK_CUR.",
+ "SEEK_SET, SEEK_END, or SEEK_CUR",
N));
return nullptr;
}
@@ -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/WebKit/RetainPtrCtorAdoptChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
index afa9fc7b1c4a4a..f5eea6794bdce4 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
@@ -578,10 +578,9 @@ 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 << ".";
assert(BR && "expected nonnull BugReporter");
PathDiagnosticLocation BSLoc(CE->getSourceRange().getBegin(),
@@ -599,10 +598,9 @@ 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 << ".";
assert(BR && "expected nonnull BugReporter");
PathDiagnosticLocation BSLoc(CE->getSourceRange().getBegin(),
@@ -618,7 +616,7 @@ class RetainPtrCtorAdoptChecker
SmallString<100> Buf;
llvm::raw_svector_ostream Os(Buf);
- Os << "The return value is +1 and results in a memory leak.";
+ Os << "The return value is +1 and results in a memory leak";
PathDiagnosticLocation BSLoc(E->getSourceRange().getBegin(),
BR->getSourceManager());
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/edges-new.mm.plist b/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
index 04f9d3e41ebf00..35371a13d4f980 100644
--- a/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
@@ -21387,9 +21387,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -21462,9 +21462,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -21571,9 +21571,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -21680,9 +21680,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -21789,9 +21789,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -21927,9 +21927,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
diff --git a/clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist b/clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist
index b8bc7361111108..0b423a02990e98 100644
--- a/clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist
@@ -1872,9 +1872,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
diff --git a/clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist b/clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
index 23bd69851c0be2..8d33748b00e6c5 100644
--- a/clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
@@ -649,9 +649,9 @@
</array>
<key>depth</key><integer>4</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
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..adaab0428a355e 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
@@ -350,9 +350,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -425,9 +425,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -500,9 +500,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -699,9 +699,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -896,9 +896,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</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..48993cdce8f2e7 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
@@ -142,9 +142,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -217,9 +217,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -561,9 +561,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -636,9 +636,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -1234,9 +1234,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -1431,9 +1431,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -1786,9 +1786,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -11097,9 +11097,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -11348,9 +11348,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -15040,9 +15040,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -17137,9 +17137,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -19412,9 +19412,9 @@
</array>
<key>depth</key><integer>1</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>event</string>
@@ -21337,9 +21337,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -22265,9 +22265,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -22519,9 +22519,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -22769,9 +22769,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -23035,9 +23035,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -25388,9 +25388,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -25675,9 +25675,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</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..61339d7c861a48 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
@@ -142,9 +142,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -217,9 +217,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -561,9 +561,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -636,9 +636,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count decremented. The object now has a +1 retain count</string>
+ <string>Reference count decremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -1234,9 +1234,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -1431,9 +1431,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -1786,9 +1786,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -11097,9 +11097,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -11348,9 +11348,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -15108,9 +15108,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -17206,9 +17206,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -19481,9 +19481,9 @@
</array>
<key>depth</key><integer>1</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>event</string>
@@ -21406,9 +21406,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -22334,9 +22334,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -22588,9 +22588,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -22838,9 +22838,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -23104,9 +23104,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +1 retain count</string>
+ <string>Reference count incremented; the object now has a +1 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -25457,9 +25457,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</string>
@@ -25744,9 +25744,9 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
<key>message</key>
- <string>Reference count incremented. The object now has a +2 retain count</string>
+ <string>Reference count incremented; the object now has a +2 retain count</string>
</dict>
<dict>
<key>kind</key><string>control</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/cstring-syntax.c b/clang/test/Analysis/cstring-syntax.c
index e992d3f8093363..2334ce525e5fe7 100644
--- a/clang/test/Analysis/cstring-syntax.c
+++ b/clang/test/Analysis/cstring-syntax.c
@@ -23,10 +23,10 @@ size_t strlcat(char *, const char *, size_t);
void testStrncat(const char *src) {
char dest[10];
- strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(dest) - 1); // expected-warning {{Potential buffer overflow. Replace with 'sizeof(dest) - strlen(dest) - 1' or use a safer 'strlcat' API}}
- strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(dest)); // expected-warning {{Potential buffer overflow. Replace with}}
- strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(dest) - strlen(dest)); // expected-warning {{Potential buffer overflow. Replace with}}
- strncat(dest, src, sizeof(src)); // expected-warning {{Potential buffer overflow. Replace with}}
+ strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(dest) - 1); // expected-warning {{Potential buffer overflow; replace with 'sizeof(dest) - strlen(dest) - 1' or use a safer 'strlcat' API}}
+ strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(dest)); // expected-warning {{Potential buffer overflow; replace with}}
+ strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(dest) - strlen(dest)); // expected-warning {{Potential buffer overflow; replace with}}
+ strncat(dest, src, sizeof(src)); // expected-warning {{Potential buffer overflow; replace with}}
// Should not crash when sizeof has a type argument.
strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(char));
}
@@ -40,11 +40,11 @@ void testStrlcpy(const char *src) {
strlcpy(dest, src, sizeof(dest));
strlcpy(dest, src, destlen);
strlcpy(dest, src, 10);
- strlcpy(dest, src, 20); // expected-warning {{The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(dest) or lower}}
- strlcpy(dest, src, badlen); // expected-warning {{The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(dest) or lower}}
+ strlcpy(dest, src, 20); // expected-warning {{The third argument allows to potentially copy more bytes than it should; replace with the value sizeof(dest) or lower}}
+ strlcpy(dest, src, badlen); // expected-warning {{The third argument allows to potentially copy more bytes than it should; replace with the value sizeof(dest) or lower}}
strlcpy(dest, src, ulen);
strlcpy(dest + 5, src, 5);
- strlcpy(dest + 5, src, 10); // expected-warning {{The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(<destination buffer>) or lower}}
+ strlcpy(dest + 5, src, 10); // expected-warning {{The third argument allows to potentially copy more bytes than it should; replace with the value sizeof(<destination buffer>) or lower}}
strlcpy(dest, "aaaaaaaaaaaaaaa", 10); // no-warning
}
@@ -59,10 +59,10 @@ void testStrlcat(const char *src) {
strlcpy(dest, "0123456789", sizeof(dest));
strlcpy(dest, "0123456789", sizeof(dest));
strlcat(dest, "0123456789", badlen / 2);
- strlcat(dest, "0123456789", badlen); // expected-warning {{The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(dest) or lower}}
+ strlcat(dest, "0123456789", badlen); // expected-warning {{The third argument allows to potentially copy more bytes than it should; replace with the value sizeof(dest) or lower}}
strlcat(dest, "0123456789", badlen - strlen(dest) - 1);
strlcat(dest, src, ulen);
strlcpy(dest, src, 5);
- strlcat(dest + 5, src, badlen); // expected-warning {{The third argument allows to potentially copy more bytes than it should. Replace with the value sizeof(<destination buffer>) or lower}}
+ strlcat(dest + 5, src, badlen); // expected-warning {{The third argument allows to potentially copy more bytes than it should; replace with the value sizeof(<destination buffer>) or lower}}
strlcat(dest, "aaaaaaaaaaaaaaa", 10); // no-warning
}
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.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/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/osobject-retain-release.cpp b/clang/test/Analysis/osobject-retain-release.cpp
index 63fd784f6dd04a..197fa74bb4bd3e 100644
--- a/clang/test/Analysis/osobject-retain-release.cpp
+++ b/clang/test/Analysis/osobject-retain-release.cpp
@@ -65,7 +65,7 @@ bool test_meta_cast_no_leak(OSMetaClassBase *arg) {
static void consumedMismatch(OS_CONSUME OSObject *a,
OSObject *b) { // expected-note{{Parameter 'b' starts at +0}}
a->release();
- b->retain(); // expected-note{{Reference count incremented. The object now has a +1 retain count}}
+ b->retain(); // expected-note{{Reference count incremented; the object now has a +1 retain count}}
} // expected-warning{{Potential leak of an object of type 'OSObject'}}
// expected-note at -1{{Object leaked: allocated object of type 'OSObject' is not referenced later in this execution path and has a retain count of +1}}
@@ -358,7 +358,7 @@ void check_free_no_error() {
void check_free_use_after_free() {
OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
- arr->retain(); // expected-note{{Reference count incremented. The object now has a +2 retain count}}
+ arr->retain(); // expected-note{{Reference count incremented; the object now has a +2 retain count}}
arr->free(); // expected-note{{Object released}}
arr->retain(); // expected-warning{{Reference-counted object is used after it is released}}
// expected-note at -1{{Reference-counted object is used after it is released}}
@@ -597,8 +597,8 @@ void use_after_release() {
void potential_leak() {
OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
- arr->retain(); // expected-note{{Reference count incremented. The object now has a +2 retain count}}
- arr->release(); // expected-note{{Reference count decremented. The object now has a +1 retain count}}
+ arr->retain(); // expected-note{{Reference count incremented; the object now has a +2 retain count}}
+ arr->release(); // expected-note{{Reference count decremented; the object now has a +1 retain count}}
arr->getCount();
} // expected-warning{{Potential leak of an object stored into 'arr'}}
// expected-note at -1{{Object leaked: object allocated and stored into 'arr' is not referenced later in this execution path and has a retain count of +1}}
@@ -676,13 +676,13 @@ void test_smart_ptr_uaf() {
// expected-note at os_smart_ptr.h:13{{Field 'pointer' is non-null}}
// expected-note at os_smart_ptr.h:13{{Taking true branch}}
// expected-note at os_smart_ptr.h:14{{Calling 'smart_ptr::_retain'}}
- // expected-note at os_smart_ptr.h:71{{Reference count incremented. The object now has a +2 retain count}}
+ // expected-note at os_smart_ptr.h:71{{Reference count incremented; the object now has a +2 retain count}}
// expected-note at os_smart_ptr.h:14{{Returning from 'smart_ptr::_retain'}}
} // expected-note{{Calling '~smart_ptr'}}
// expected-note at os_smart_ptr.h:35{{Field 'pointer' is non-null}}
// expected-note at os_smart_ptr.h:35{{Taking true branch}}
// expected-note at os_smart_ptr.h:36{{Calling 'smart_ptr::_release'}}
- // expected-note at os_smart_ptr.h:76{{Reference count decremented. The object now has a +1 retain count}}
+ // expected-note at os_smart_ptr.h:76{{Reference count decremented; the object now has a +1 retain count}}
// expected-note at os_smart_ptr.h:36{{Returning from 'smart_ptr::_release'}}
// expected-note at -6{{Returning from '~smart_ptr'}}
obj->release(); // expected-note{{Object released}}
@@ -699,13 +699,13 @@ void test_smart_ptr_leak() {
// expected-note at os_smart_ptr.h:13{{Field 'pointer' is non-null}}
// expected-note at os_smart_ptr.h:13{{Taking true branch}}
// expected-note at os_smart_ptr.h:14{{Calling 'smart_ptr::_retain'}}
- // expected-note at os_smart_ptr.h:71{{Reference count incremented. The object now has a +2 retain count}}
+ // expected-note at os_smart_ptr.h:71{{Reference count incremented; the object now has a +2 retain count}}
// expected-note at os_smart_ptr.h:14{{Returning from 'smart_ptr::_retain'}}
} // expected-note{{Calling '~smart_ptr'}}
// expected-note at os_smart_ptr.h:35{{Field 'pointer' is non-null}}
// expected-note at os_smart_ptr.h:35{{Taking true branch}}
// expected-note at os_smart_ptr.h:36{{Calling 'smart_ptr::_release'}}
- // expected-note at os_smart_ptr.h:76{{Reference count decremented. The object now has a +1 retain count}}
+ // expected-note at os_smart_ptr.h:76{{Reference count decremented; the object now has a +1 retain count}}
// expected-note at os_smart_ptr.h:36{{Returning from 'smart_ptr::_release'}}
// expected-note at -6{{Returning from '~smart_ptr'}}
} // expected-warning{{Potential leak of an object stored into 'p'}}
@@ -742,8 +742,8 @@ OSObject *createRuleViolation(OSObject *param) { // expected-note{{Parameter 'pa
void test_ostypealloc_correct_diagnostic_name() {
OSArray *arr = OSTypeAlloc(OSArray); // expected-note{{Call to method 'OSMetaClass::alloc' returns an OSObject of type 'OSArray' with a +1 retain count}}
- arr->retain(); // expected-note{{Reference count incremented. The object now has a +2 retain count}}
- arr->release(); // expected-note{{Reference count decremented. The object now has a +1 retain count}}
+ arr->retain(); // expected-note{{Reference count incremented; the object now has a +2 retain count}}
+ arr->release(); // expected-note{{Reference count decremented; the object now has a +1 retain count}}
} // expected-note{{Object leaked: object allocated and stored into 'arr' is not referenced later in this execution path and has a retain count of +1}}
// expected-warning at -1{{Potential leak of an object stored into 'arr'}}
diff --git a/clang/test/Analysis/padding_message.cpp b/clang/test/Analysis/padding_message.cpp
index e8b9f4022a775d..80075d728875dd 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/retain-release-arc.m b/clang/test/Analysis/retain-release-arc.m
index e0f4c4d1da2a1f..2fe392f397d906 100644
--- a/clang/test/Analysis/retain-release-arc.m
+++ b/clang/test/Analysis/retain-release-arc.m
@@ -159,7 +159,7 @@ void libdispatch_leaked_retained_data(void) {
#if !HAS_ARC
// expected-warning at -2{{Potential leak of an object stored into 'data'}}
// expected-note at -9{{Call to function 'dispatch_data_create' returns an Objective-C object with a +1 retain count}}
-// expected-note at -7{{Reference count incremented. The object now has a +2 retain count}}
-// expected-note at -7{{Reference count decremented. The object now has a +1 retain count}}
+// expected-note at -7{{Reference count incremented; the object now has a +2 retain count}}
+// expected-note at -7{{Reference count decremented; the object now has a +1 retain count}}
// expected-note at -6{{Object leaked: object allocated and stored into 'data' is not referenced later in this execution path and has a retain count of +1}}
#endif
diff --git a/clang/test/Analysis/retain-release-path-notes.m b/clang/test/Analysis/retain-release-path-notes.m
index 3c193c1e2bc4fd..bc0f3d0e61889f 100644
--- a/clang/test/Analysis/retain-release-path-notes.m
+++ b/clang/test/Analysis/retain-release-path-notes.m
@@ -55,21 +55,21 @@ void creationViaCFCreate (void) {
void acquisitionViaMethod (Foo *foo) {
id leaked = [foo methodWithValue]; // expected-note{{Method returns an Objective-C object with a +0 retain count}}
- [leaked retain]; // expected-note{{Reference count incremented. The object now has a +1 retain count}}
- [leaked retain]; // expected-note{{Reference count incremented. The object now has a +2 retain count}}
- [leaked release]; // expected-note{{Reference count decremented. The object now has a +1 retain count}}
+ [leaked retain]; // expected-note{{Reference count incremented; the object now has a +1 retain count}}
+ [leaked retain]; // expected-note{{Reference count incremented; the object now has a +2 retain count}}
+ [leaked release]; // expected-note{{Reference count decremented; the object now has a +1 retain count}}
return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void acquisitionViaProperty (Foo *foo) {
id leaked = foo.propertyValue; // expected-note{{Property returns an Objective-C object with a +0 retain count}}
- [leaked retain]; // expected-note{{Reference count incremented. The object now has a +1 retain count}}
+ [leaked retain]; // expected-note{{Reference count incremented; the object now has a +1 retain count}}
return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void acquisitionViaCFFunction (void) {
CFTypeRef leaked = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count}}
- CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count}}
+ CFRetain(leaked); // expected-note{{Reference count incremented; the object now has a +1 retain count}}
return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
@@ -283,7 +283,7 @@ - (id)manualProp {
- (void)testOverreleaseUnownedIvar {
[_unownedProp retain]; // FIXME-note {{Object loaded from instance variable}}
- // FIXME-note at -1 {{Reference count incremented. The object now has a +1 retain count}}
+ // FIXME-note at -1 {{Reference count incremented; the object now has a +1 retain count}}
[_unownedProp release]; // FIXME-note {{Reference count decremented}}
[_unownedProp release]; // FIXME-note {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
// FIXME-warning at -1 {{not owned at this point by the caller}}
@@ -291,7 +291,7 @@ - (void)testOverreleaseUnownedIvar {
- (void)testOverreleaseOwnedIvarUse {
[_ownedProp retain]; // FIXME-note {{Object loaded from instance variable}}
- // FIXME-note at -1 {{Reference count incremented. The object now has a +1 retain count}}
+ // FIXME-note at -1 {{Reference count incremented; the object now has a +1 retain count}}
[_ownedProp release]; // FIXME-note {{Reference count decremented}}
[_ownedProp release]; // FIXME-note {{Strong instance variable relinquished. Object released}}
[_ownedProp myMethod]; // FIXME-note {{Reference-counted object is used after it is released}}
@@ -300,7 +300,7 @@ - (void)testOverreleaseOwnedIvarUse {
- (void)testOverreleaseIvarOnlyUse {
[_ivarOnly retain]; // FIXME-note {{Object loaded from instance variable}}
- // FIXME-note at -1 {{Reference count incremented. The object now has a +1 retain count}}
+ // FIXME-note at -1 {{Reference count incremented; the object now has a +1 retain count}}
[_ivarOnly release]; // FIXME-note {{Reference count decremented}}
[_ivarOnly release]; // FIXME-note {{Strong instance variable relinquished. Object released}}
[_ivarOnly myMethod]; // FIXME-note {{Reference-counted object is used after it is released}}
@@ -309,7 +309,7 @@ - (void)testOverreleaseIvarOnlyUse {
- (void)testOverreleaseOwnedIvarAutorelease {
[_ownedProp retain]; // FIXME-note {{Object loaded from instance variable}}
- // FIXME-note at -1 {{Reference count incremented. The object now has a +1 retain count}}
+ // FIXME-note at -1 {{Reference count incremented; the object now has a +1 retain count}}
[_ownedProp release]; // FIXME-note {{Reference count decremented}}
[_ownedProp autorelease]; // FIXME-note {{Object autoreleased}}
[_ownedProp autorelease]; // FIXME-note {{Object autoreleased}}
@@ -318,7 +318,7 @@ - (void)testOverreleaseOwnedIvarAutorelease {
- (void)testOverreleaseIvarOnlyAutorelease {
[_ivarOnly retain]; // FIXME-note {{Object loaded from instance variable}}
- // FIXME-note at -1 {{Reference count incremented. The object now has a +1 retain count}}
+ // FIXME-note at -1 {{Reference count incremented; the object now has a +1 retain count}}
[_ivarOnly release]; // FIXME-note {{Reference count decremented}}
[_ivarOnly autorelease]; // FIXME-note {{Object autoreleased}}
[_ivarOnly autorelease]; // FIXME-note {{Object autoreleased}}
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..52967030318267 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 154f0c1bae427c..be7943b50b7a8b 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
@@ -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/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/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