This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: #import and PCH
nicola@brainstorm.co.uk (Nicola Pero) wrote on 25.01.03 in <Pine.LNX.4.21.0301250134440.4556-100000@nicola.brainstorm.co.uk>:
> > That warning predates the introduction of OS X, and wasn't very well
> > advertised, if confused messages from ObjC users are anything to go
> > by. The latest GNUstep argument about using #import was only a few
> > months ago. I just grepped through latest GNUstep in CVS and it has
> > 16000 #include vs 2000 #import statements so at least the tide is
> > turning, but it's not there yet.
>
> The 'official' position of GNUstep is well known: #include only must be
> used in core libraries. Users are free to use what they wish in their
> code (we can't quarrel too much with our users), but #include is slightly
> encouraged.
As long as the official Foundation docs use #import, I'd say removing
#import for Objective C, or enforcing warnings for it, is not justifiable.
That doesn't necessarily mean that it cannot be deprecated for all other
languages; AFAICT there is no such justification for those.
What *could* be done is (in FSF GCC) eliminate or deprecate the use-once
effect, turning #import into an alias for #include and telling users to
fix their headers if that doesn't work.
MfG Kai