This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: #import future (summary and proposed solutions)


>This is a small aside, but perhaps having PCH not work for
>Objective-C with #import is desirable after all.  It's an incentive
>to use #include.

That could break any code that someone writes from the books that
describe objective-c.

What is the problem of #import anyway?  If in a compilation unit an
include file (after fully expanding its path) has been '#import'ed then
another instance of '#import' on the samve file (that matches the
fully expanded path) will skipp it since its definitons/declarations
have already been seen in the token stream. I see this as a perfomance
boon since the compier doesn't have to bother opening/reading the
file. And for classes that are built up upon other classes, it saves
countless redeclarations of the same types which *should* speed up the
compliation.  We all know that gcc is already slow, why make it slower...

If however the file is '#include'd then it should be read again.

-- 
Peter Barada
peter@baradas.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]