discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: building dbuskit fails with llvm/clang


From: David Chisnall
Subject: Re: building dbuskit fails with llvm/clang
Date: Sun, 10 Apr 2011 14:29:48 +0100

On 10 Apr 2011, at 12:30, Nicola Pero wrote:

> If you message an object of a class which is only declared using @class,
>   you should get a warning.  Both GCC and clang don't warn about this.


I think clang does.  The problem is that, in this case, it never sees that the 
instances are of forward-declared classes.  They are created with alloc / init, 
so they are treated as id.  This is a separate issue, and there was a 
discussion on the clang list a while ago about adding a pair of __attribute__s, 
one indicating that the returned object is of the same type as the receiver, 
and another indicating that it's an instance of the receiver, so that +alloc 
and -init (for example) can be annotated like this and the compiler can 
correctly type check the returned objects.

David

-- Sent from my Cray X1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]