This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: #import, #pragma once yadda yadda mumble grumble
- From: Jonathan Lennox <lennox at cs dot columbia dot edu>
- To: gcc-patches at gcc dot gnu dot org, Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Mike Stump <mrs at apple dot com>, Nicola Pero <nicola at brainstorm dot co dot uk>, Geoffrey Keating <geoffk at apple dot com>, gcc at gcc dot gnu dot org, Stan Shebs <shebs at apple dot com>, Zack Weinberg <zack at codesourcery dot com>, David Ayers <d dot ayers at inode dot at>
- Date: Tue, 29 Jul 2003 19:02:19 -0400
- Subject: Re: #import, #pragma once yadda yadda mumble grumble
- References: <20030729222547.GF14334@daikokuya.co.uk>
Neil Booth writes:
> I hope this puts past endless discussions to rest at last.
I hope so too, but I have a few questions about semantics of #import /
#pragma once (which have always been the matter of much debate).
1) What definition of "the same file" are you using? When you say you "it
doesn't second-guess the filesystem", do you mean that the rule is just
"same absolute path, before any link or .. resolution"? There are cases
where that would break, but they would -- arguably -- deserve to be broken.
2) What happens if you mix #include and #import of the same file?
3) If you #import a file to a PCH file, and then later use the PCH file and
also re-#import the file outside of the PCH file, what happens? What if
it's on another host? (This could definitely fall into the category of
"deserves to break".)
These cases should probably be documented in the CPP manual (even if it's
just to explicitly make some behavior undefined).
--
Jonathan Lennox
lennox at cs dot columbia dot edu