llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang-static-analyzer-1 Author: Benedek Kaibas (benedekaibas) <details> <summary>Changes</summary> Until now, there was no consensus between using single spaces or double spaces after sentence endings in the emitted diagnostics by the Clang Static Analyzer (CSA). This led to inconsistently formatted diagnostics by the CSA. Currently there are the following cases where the CSA is not consistent with the Clang compiler: - 1: Using double spaces after sentence endings - 2: Using multiple full sentences in diagnostics - 3: Using a capital letter at the start of the diagnostic #<!-- -->228777 resolves point 1 and partially 2. #<!-- -->236804 resolves points 1 and 2 in `BugReporter`. This PR resolves point 2 in the rest of the Clang Static Analyzer's checker. To uplift downstream tests someone needs to convert multiple full sentences in the test suite to single sentences using `;` or `,`. --- Patch is 121.58 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/237410.diff 43 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp (+9-6) - (modified) clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp (+11-12) - (modified) clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp (+2-2) - (modified) clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp (+2-2) - (modified) clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp (+1-1) - (modified) clang/lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp (+1-1) - (modified) clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp (+1-1) - (modified) clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp (+3-3) - (modified) clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp (+1-1) - (modified) clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp (+7-5) - (modified) clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp (+1-1) - (modified) clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (+7-7) - (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp (+2-4) - (modified) clang/lib/StaticAnalyzer/Core/BugReporter.cpp (+3-3) - (modified) clang/test/Analysis/CheckNSError.m (+3-3) - (modified) clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use-arc.mm (+13-13) - (modified) clang/test/Analysis/Checkers/WebKit/retain-ptr-ctor-adopt-use.mm (+13-13) - (modified) clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist (+12-12) - (modified) clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist (+2-2) - (modified) clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist (+2-2) - (modified) clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist (+10-10) - (modified) clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist (+38-38) - (modified) clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist (+38-38) - (modified) clang/test/Analysis/c11lock.c (+1-1) - (modified) clang/test/Analysis/cstring-syntax.c (+9-9) - (modified) clang/test/Analysis/fuchsia_lock.c (+2-2) - (modified) clang/test/Analysis/incorrect-checker-names.mm (+2-2) - (modified) clang/test/Analysis/localization.m (+9-9) - (modified) clang/test/Analysis/mig.mm (+10-10) - (modified) clang/test/Analysis/mmap-writeexec.c (+3-3) - (modified) clang/test/Analysis/osobject-retain-release.cpp (+10-10) - (modified) clang/test/Analysis/padding_message.cpp (+40-40) - (modified) clang/test/Analysis/pthreadlock.c (+5-5) - (modified) clang/test/Analysis/retain-release-arc.m (+2-2) - (modified) clang/test/Analysis/retain-release-path-notes.m (+10-10) - (modified) clang/test/Analysis/security-syntax-checks-nscoder.m (+1-1) - (modified) clang/test/Analysis/security-syntax-checks.c (+5-5) - (modified) clang/test/Analysis/security-syntax-checks.m (+4-4) - (modified) clang/test/Analysis/std-c-library-functions-arg-constraints-notes.cpp (+2-2) - (modified) clang/test/Analysis/stream-note.c (+20-20) - (modified) clang/test/Analysis/stream-notes-missing-close.cpp (+16-16) - (modified) clang/test/Analysis/stream.c (+3-3) - (modified) clang/test/Analysis/stream.cpp (+1-1) ``````````diff diff --git a/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp index bfd90beb82cdeb..8ac9804333988b 100644 --- a/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp @@ -226,13 +226,15 @@ 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 << ") " - "- strlen(" << DstName <<") - 1'"; + 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 +253,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..39eb7cd3aee21f 100644 --- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp @@ -866,7 +866,7 @@ class StdLibraryFunctionsChecker if (ValuesPrinted) MsgOs << " but "; else - MsgOs << "is out of the accepted range; It "; + MsgOs << "is out of the accepted range; it "; VC->describe(ValueConstraint::Violation, Call, C.getState(), Summary, MsgOs); Msg[0] = toupper(Msg[0]); diff --git a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp index 92789eb462e74f..92ae7a87f039b4 100644 --- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp @@ -1914,8 +1914,8 @@ ProgramStateRef StreamChecker::ensureStreamOpened(SVal StreamVal, C.emitReport(std::make_unique<PathSensitiveBugReport>( BT_UseAfterOpenFailed, "Stream might be invalid after " - "(re-)opening it has failed. " - "Can cause undefined behaviour.", + "(re-)opening it has failed; " + "can cause undefined behaviour", N)); return nullptr; } @@ -1928,8 +1928,8 @@ ProgramStateRef StreamChecker::ensureNoFilePositionIndeterminate( SVal StreamVal, CheckerContext &C, ProgramStateRef State) const { static const char *BugMessage = "File position of the stream might be 'indeterminate' " - "after a failed operation. " - "Can cause undefined behavior."; + "after a failed operation; " + "can cause undefined behavior"; SymbolRef Sym = StreamVal.getAsSymbol(); if (!Sym) @@ -2002,8 +2002,8 @@ void StreamChecker::reportFEofWarning(SymbolRef StreamSym, CheckerContext &C, if (ExplodedNode *N = C.generateNonFatalErrorNode(State)) { auto R = std::make_unique<PathSensitiveBugReport>( BT_StreamEof, - "Read function called when stream is in EOF state. " - "Function has no effect.", + "Read function called when stream is in EOF state; " + "function has no effect", N); R->markInteresting(StreamSym); C.emitReport(std::move(R)); @@ -2042,7 +2042,7 @@ StreamChecker::reportLeaks(const SmallVector<SymbolRef, 2> &LeakedSyms, std::unique_ptr<PathSensitiveBugReport> R = std::make_unique<PathSensitiveBugReport>( BT_ResourceLeak, - "Opened stream never closed. Potential resource leak.", Err, + "Opened stream never closed; potential resource leak", Err, LocUsedForUniqueing, StreamOpenNode->getStackFrame()->getDecl()); R->markInteresting(LeakSym); R->addVisitor<NoStreamStateChangeVisitor>(LeakSym, this); diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp index afa9fc7b1c4a4a..9ccd438bdae205 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(), diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 25d10df604bda1..a33df51fb8ff09 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -785,9 +785,9 @@ PathDiagnosticPieceRef PathDiagnosticBuilder::generateDiagForSwitchOP( switch (S->getStmtClass()) { default: - os << "No cases match in the switch statement. " - "Control jumps to line " - << End.asLocation().getExpansionLineNumber(); + os << "No cases match in the switch statement; " + "control jumps to line " + << End.asLocation().getExpansionLineNumber(); break; case Stmt::DefaultStmtClass: os << "Control jumps to the 'default' case at line " 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/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... [truncated] `````````` </details> https://github.com/llvm/llvm-project/pull/237410 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
