On Thu, Aug 08, 2002 at 10:34:11AM -0700, Stan Shebs wrote:
Heh, we tried that argument with our users, but with literally thousands
of headers assuming #import or #pragma once, both internal and external
to Apple, plus an Objective-C book or two recommending the practice,
the response was, shall we say, "negative". It was pretty clear they
were going to keep firing compiler folks until they found one who was
willing to un-deprecate #import. 1/2 :-)
In the users' defense, it must be said that #import has been working
well on a huge amount of code - in the 2 1/2 years that I've been at
Apple, we've seen dozens of ICEs for instance, but no failures of
#import to find the right file. So it's not surprising that users
wonder why we're trying to fix something that doesn't seem broken.
Understood.
Apple's in a different boat from FSF GCC - you are only interested in
one platform, and you can make sure that ino/dev comparisons work
properly there. I suppose I could live with a patch to disable that
warning for Darwin and Objective C only. However, you could at least
update your own documentation to encourage use of #include and #ifndef
wrappers instead. You could borrow the rationale from cpp.texi
(I wrote that text; you have my permission to use it)
There's also a concern about what it means to use both #include and
#import on the same file. From the manual:
| In the present implementation, a single use of `#import' will
| prevent the file from ever being read again, by either `#import' or
| `#include'. You should not rely on this; do not use both `#import'
| and `#include' to refer to the same header file.
Is #pragma once in active use as well as #import? Neil wanted to
ditch #pragma once.