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: Devang Patel <dpatel at apple dot com>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Jonathan Lennox <lennox at cs dot columbia dot edu>, gcc-patches at gcc dot gnu dot org, 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: Wed, 30 Jul 2003 09:55:40 -0700
- Subject: Re: #import, #pragma once yadda yadda mumble grumble
- References: <20030729222547.GF14334@daikokuya.co.uk> <16166.64763.272569.879473@grandcentral.cs.columbia.edu> <16167.1216.601077.143154@grandcentral.cs.columbia.edu> <20030730052359.GG14334@daikokuya.co.uk>
On Tuesday, July 29, 2003, at 10:23 PM, Neil Booth wrote:
2) What happens if you mix #include and #import of the same file?
Nothing in particular; #import behavior is only affected by previous
#import
directives, not by #include, and #include ignores any previous
#import's.
Yes.
Your patch changes semantics for following example.
#include "a.h"
#import "a.h"
#include "a.h"
And a.h does not have include guards.
FSF GCC 3.4 before and after your patch behaves differently.
*If* we consider Darwin compilers as reference in this case then
following
compiler versions include content of a.h only once in this example.
- Darwin GCC 2.95 + Apple preprocessor
- Darwin GCC 2.95 + GNU preprocessor
- Darwin GCC 3.1 + Apple preprocessor
- Darwin GCC 3.1 + GNU preprocessor
- Darwin GCC 3.3
--
Devang