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: A FrontEnd in C++?


On Monday, August 19, 2002, at 12:46 AM, Fergus Henderson wrote:

Use `extern "C"', either in the C++ code, e.g.

	extern "C" {
	  #include "tree.h"
	}

or by modifying the GCC headers, e.g.

	/* tree.h */
	#ifdef __cplusplus
	extern "C" {
	#endif

	... body of tree.h goes here

	#ifdef __cplusplus
	}
	#endif
The latter is probably a good idea regardless: it's nice to be able to
include tree.h in projects that aren't strictly part of the compiler, and
some of those projects are written in C++.

(When I was at SGI, for example, and we were working on a
tree-to-WHIRL translator, I wrote a tree consistency checker in
C++.)

--Matt


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