<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - False positive when using a category on NSMutableArray"
href="http://llvm.org/bugs/show_bug.cgi?id=18908">18908</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>False positive when using a category on NSMutableArray
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>kremenek@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>carsten.wenderdel@immobilienscout24.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>There seems to be a false positive in the current Xcode versions of the static
analyser (Xcode 5.0.2/5A3005 and 5.1/5B103i)
The warning is: "Arguments to 'NSMutableArray' method 'addObject:safe:' cannot
be nil"
The line with the warning is:
[myMutableArray addObject:someObjectThatCouldBeNil safe:YES];
This method is not part of Apples Code but added through a category by us:
- (void) addObject:(id)anObject safe:(BOOL)value {
if (value) {
if (anObject) {
return [self addObject:anObject];
}
return;
}
return [self addObject:anObject];
}
The code seems fine to me as we check for nil values.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>