This is the mail archive of the gcc-patches@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: #import, #pragma once yadda yadda mumble grumble



On Wednesday, July 30, 2003, at 01:07 PM, Neil Booth wrote:


Devang Patel wrote:-

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

Does this matter to Apple? If so, I'm willing to change it, it only makes #import more expensive, encouraging people to use header guards 8-)

Yes, unfortunately, some Apple code relies on it. (Most Apple headers have guards anyway, so the performance issue isn't so much of a problem.)


--
Geoff Keating <geoffk@apple.com>


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