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: FSF GCC, #import and #pragma once



On Tuesday, March 4, 2003, at 02:01 PM, Neil Booth wrote:


Geoffrey Keating wrote:-


On Tuesday, March 4, 2003, at 01:09 PM, Neil Booth wrote:


I've a suggestion to make that I'm hoping will break the impasse here.
...

I suggest waiting until my upcoming cppfiles rewrite is complete and we
discuss this then.

I think that's a good reason to discuss it now. We don't want to have big changes before agreeing what we want to do.

OK, then, I propose that:


1. We undeprecate #import in GCC for objective-C.
2. The semantics of #import become that:
A. #import A followed by #import B will include B only if its content
differs from the content of A.
B. #import A followed by #include B will include B only if its content
differs from the content of A.
C. #include A followed by #import B will include B only if its content
differs from the content of A.
3. Users are warned that #import without multiple-include guards can
impose a compile-speed penalty.
4. #pragma once behaves as if the file was included with #import


The reason I propose this is that this is what I have to implement anyway for Apple, and it'll save me work if I can just use the same code in FSF cpplib.

I'm uncertain about:

5. We disable (not warn about, disable) #import and #pragma once in C and C++
unless the user gives a flag to switch it on.


The reason for this is that the combination of 2(C) and PCH mean that every included file has to get checksummed when building a PCH file. I'm not sure how much overhead this might be, and am deferring an opinion on (5) until I get timing numbers.

--
Geoff Keating <geoffk at apple dot com>


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