[LLVMbugs] [Bug 13276] Spurious errors for Objective-C string comparison

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 9 17:51:31 PDT 2012


Jordan Rose <jordan_rose at apple.com> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #4 from Jordan Rose <jordan_rose at apple.com> 2012-07-09 19:51:31 CDT ---
This is almost always a bad idea, especially for keys that pass through
non-opaque object pointers in the frameworks. I've added a note in r159972 at
http://clang.llvm.org/docs/ObjectiveCLiterals.html under "Caveats".

Using == to compare general objects for equality does have more reasonable
uses, such as to determine which table view you are currently being a data
source for. (Admittedly, being a data source for two table views is probably a
bad idea for other reasons, but...)

The "== nil" case is a good point, though. I think this should still warn in
macros, but perhaps not warn for comparisons to nil.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list