ObjC/ObjC++: Tidy up #includes of objc-act.c

Joseph S. Myers joseph@codesourcery.com
Thu Dec 2 00:07:00 GMT 2010


On Wed, 1 Dec 2010, Nicola Pero wrote:

> >> #include "system.h"
> >> #include "coretypes.h"
> >> -#include "tm.h"
> >> #include "tree.h"
> >>
> >> Hum, you didn't actually test this did you?
> 
> Of course I did.  It still works because target.h pulls in tm.h anyway.

I really don't recommend relying on that since we'd like to stop target.h 
pulling in tm.h.  Instead, comment the tm.h include with a list of all 
target macros you can find being used in this file.

In general, unless it is clear that a header logically *should* export all 
the interfaces from another header, I recommend directly including all the 
headers from which you use any interface, even if some of them are 
implicitly included by another header as well.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list