[cfe-dev] @encode objc problem

steve naroff snaroff at apple.com
Sat Mar 7 14:06:05 PST 2009


I just filed <rdar://problem/6657710> @encode doesn't emit unique  
string pointers.

Thanks for the bug report.

snaroff

On Mar 7, 2009, at 2:49 PM, Jean-Daniel Dupas wrote:

>
> Le 7 mars 09 à 19:52, Jean-Daniel Dupas a écrit :
>
>> Hello,
>>
>> I have a question about the behavior of the @encode compiler  
>> directive
>> in Obj-C.
>>
>> If we where talking about another language the answer would probably
>> be: read the spec, unfortunately, there is not Obj-C spec.
>>
>> From the Objective-C 2.0 Programming Language:
>> 	@encode(type_spec) 	Yields a character string that encodes the type
>> structure of type_spec.
>>
>> http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_950_section_5.html
>>
>>
>> So we could think that the clang implementation is fine, but here  
>> come
>> the bad news.
>
>
> I forgot to mention that actually, clang generates a different string
> for each @encode directive, and so @encode(a) == @encode(b) is always
> false.
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list