[cfe-commits] r66635 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.def test/SemaObjC/bad-receiver-1.m test/SemaObjC/message.m test/SemaObjC/super.m
clattner at apple.com
Wed Mar 11 10:15:40 PDT 2009
On Mar 11, 2009, at 9:37 AM, Fariborz Jahanian wrote:
> Advice to casting to 'id' is not much help either (and dangerous).
> It produces a new warning. Also,
> user's intention might be a class name as receiver, etc. Best to say
> nothing IMO.
> "receiver type %0 is not 'id', Objective-C interface pointer or
> interface name")
The idea here is to emit a warning in case it was accidental, so that
the user knows that they are doing something dangerous. The "hint" is
to tell them how to silence the warning in case the behavior really is
intentional. I've seen code using CFStringRef (a pointer to a struct)
that "works fine", and the fix really is to cast to id.
More information about the cfe-commits