https://llvm.org/bugs/show_bug.cgi?id=25555
Bug ID: 25555 Summary: osx.cocoa.NSError checker false positive on overridden method Product: clang Version: unspecified Hardware: Macintosh OS: MacOS X Status: NEW Severity: normal Priority: P Component: Static Analyzer Assignee: kreme...@apple.com Reporter: levigro...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 15300 --> https://llvm.org/bugs/attachment.cgi?id=15300&action=edit Sample project demonstrating the issue. The `osx.cocoa.NSError` checker reports an analysis warning on the child implementation of an overridden method which would not pass the checker. For instance, `NSFileCoordinator` declares `- (void)coordinateReadingItemAtURL:(NSURL *)url options:(NSFileCoordinatorReadingOptions)options error:(NSError **)outError byAccessor:(void (^)(NSURL *))reader` which fails this checker (reports "Method accepting NSError** should have a non-void return value to indicate whether or not an error occurred"). A subclass of `NSFileCoordinator` which overrides this method has no choice but to use the same method signature, and therefore will fail the checker. While it may be debatable this is to be considered a false positive, a couple possible solutions come to mind: 1. Have the checker understand this is an overridden method and present the warning on the parent class. 2. Provide a way to suppress this specific checker only for this and similar overrides (perhaps via a #pragma push/pop mechanism). Please see the attached Xcode 7.1.1 project, which exhibits this issue when Xcode Analyze is performed. Thank you, Levi -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs