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: #import, #pragma once yadda yadda mumble grumble



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


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