<div><div class="gmail_quote">On Sat, Aug 15, 2009 at 4:31 AM, David Chisnall <span dir="ltr"><<a href="mailto:csdavec@swansea.ac.uk">csdavec@swansea.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 15 Aug 2009, at 02:37, Daniel Dunbar wrote:<br>
<br>
> On Fri, Aug 14, 2009 at 6:30 PM, David<br>
> Chisnall<<a href="mailto:csdavec@swansea.ac.uk">csdavec@swansea.ac.uk</a>> wrote:<br>
>> I'd like to keep it.  Long-term, I agree with Steve - having explicit<br>
>> typedefs for what should be builtin types is an ugly hack.  If we<br>
>> leave it<br>
>> in then users can slowly drop the includes of the headers that<br>
>> define these<br>
>> types and fall back to using the compiler-supplied definitions.  In<br>
>> a little<br>
>> while we can add a warning for files that define these types.<br>
><br>
> To clarify, so your position is that long term clients should drop<br>
> uses of the other fields, but direct assignment / reading of isa is<br>
> ok?<br>
<br>
</div>Yes.  The Apple runtime.h already marks the fields other than isa as<br>
deprecated with the legacy runtime and unavailable on the modern<br>
runtime.<br>
<div class="im"><br>
> One downside of that approach (aside from being speculative) is that<br>
> it encourages users to write non-portable (to gcc) code. Since it is<br>
> also speculative it seems to me to unnecessarily complicate clients,<br>
> but I'm happy to defer to others opinions on this.<br>
<br>
</div>Not really a problem for the GNU runtime - any code that uses<br>
properties or fast enumeration will compile with clang but not GCC<br>
already because no one seems to be working on Objective-C in the FSF's<br>
tree and the Apple tree doesn't support the GNU runtime.  People using<br>
the Apple runtime almost always get these definitions via Foundation.h<br>
(often indirectly via Cocoa.h), so there's little chance of them<br>
accidentally writing code that doesn't include them (although a future<br>
version of the Apple headers may choose to wrap their definitions in<br>
#ifndef __clang__).<br><font class="Apple-style-span" color="#888888"></font></blockquote><div><br></div>Why the exemption for isa?<div><br></div><div>Isa is certainly more popular to access than other fields, but there's no reason not to go through runtime functions.  </div>
<div><br></div><div>It's rather a waste of space to use a full pointer for the class id.  It would be nice if we could steal bits for refcounting and such.<br><br></div><div>-Ken</div></div></div>