[cfe-dev] @encode objc problem

Jean-Daniel Dupas devlists at shadowlab.org
Sat Mar 7 11:49:34 PST 2009


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.






More information about the cfe-dev mailing list