[cfe-dev] Fix for ObjC Class / id definition regression

David Chisnall theraven at sucs.org
Sat Aug 8 10:07:00 PDT 2009


Having looked at this in more detail, I am finding it increasingly  
difficult to see what the correct fix is.

The current code, which simply ignores the definition for any type  
named id or Class, is obviously wrong (and breaks lots of existing  
code, for example anything that includes the standard GNU runtime  
headers).

A fix needs to allow fields on variables of type id and Class to be  
accessed with normal C semantics, but also allow the pointers with the  
id and Class types to be receivers for messages.  Every approach I've  
tried breaks at least one of the required semantics.

David

On 8 Aug 2009, at 15:58, David Chisnall wrote:

> Please ignore this patch, it breaks more than it fixes (although the
> problem is real and does prevent clang from working with any  
> Objective-
> C programs on non-Apple platforms and possibly on Apple platforms with
> the legacy runtime).
>
> David
>
> On 8 Aug 2009, at 15:46, David Chisnall wrote:
>
>> Hi,
>>
>> The attached diff fixes the recently-introduced regression where
>> clang ignores the definitions of the Objective-C types in a header
>> (although not, I believe, from a precompiled header, although I'd
>> need to check that).  The attached test.m is a preprocessed file
>> including one of the GNU runtime headers which demonstrates the
>> problem.  This will also be a problem with the legacy Apple runtime,
>> but not with the modern runtime (where these types are opaque).
>>
>> David
>> <clang.diff><test.m>_______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
> _______________________________________________
> 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