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)


>1) GCC will recognize a header file with an #ifndef wrapper around its
>   entire substantive content and skip re-reading it when it is
>   #include-d a second time, which provides all the performance
>   benefits of #import.  It has done this since forever.

Sure that's useful, but only if the header writer is bright enough to
*uniquely* specify the symbol that controls its inclusion.  I've been
bitten too many times by somebody thinking that _QUEUE_H_ is *unique*
to his(and *anybody* who *includes* it) universe.

I'd much rather have #import work as it was defined by objective-c
(if a file (defined by its fuuly qualified path) is imported more than
once, then its second and further imports are ignored).  This *forces*
the author of a header to think really deep about what the are putting
into that header, and be very concerned about including it more than
once (with different preprocessor definitions as GCC is known to do).

For Objective-c class defintions, #import worked beautifully.  Why
mess with it?

-- 
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]