<html>
<head>
<base href="https://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 --- - Objective-C compiler and static analyzer fail to warn about properties to objc-object that are 'assign' instead of 'weak' / 'strong'"
href="https://llvm.org/bugs/show_bug.cgi?id=25259">25259</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Objective-C compiler and static analyzer fail to warn about properties to objc-object that are 'assign' instead of 'weak' / 'strong'
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mayer.julian@googlemail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>i just lost 3 hours in a complicated debug session because one of the
properties in my project was assign:
@property (nonatomic, assign) NSArray *fontFamilyNames;
instead of strong:
@property (nonatomic, strong) NSArray *fontFamilyNames;
since the object was used in cocoa bindings but actually deallocated this
resulted in a strange crash somewhere deep inside Apple's frameworks, and only
'malloc_history' was able to show the culprit.
i can not understand why no warning was triggered, despite using -Wall
-Weverything and running the static analyzer
using Apple LLVM version 7.0.0 (clang-700.0.72)
i'm not the only one wishing this would result in a warning:
<a href="http://stackoverflow.com/questions/31880445/xcode-warning-if-using-assign-attribute-for-reference-types-objects">http://stackoverflow.com/questions/31880445/xcode-warning-if-using-assign-attribute-for-reference-types-objects</a>
i guess not only assign but 'unsafe unretained' should also warn</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>