[RFC] Switching implementation language to C++

Mark Mitchell mark@codesourcery.com
Mon May 31 18:48:00 GMT 2010

Diego Novillo wrote:

>> By switch, do you using a C++ compiler to compile everything, or that
>> some
>> components may be written only in C++ with sufficient care that they
>> can be
>> linked with other part written in C?
> Ideally, the former.  If we cannot get consensus on that, then I guess
> we'd have to settle for the latter.

I don't think a partial conversion strategy will be very successful.  As
soon as we use C++ in tree.h, we're going to have to use it everywhere.
 And, I suspect that using single inheritance in tree.h is the sort of
change that will cut down on a fair bit of casting, possibly helping us
to invalid conversions.

That doesn't necessarily mean that we have to use lots of C++ features
everywhere.  We can use the C (almost) subset of C++ if we want to in
some places.  As an example, if the Fortran folks want to use C in the
Fortran front-end, then -- except to the extent required by the common
interfaces, those files could read as if they were C code.  But, I think
they'd still need to be compiled with a C++ compiler because they'll
probably pull in headers that use C++ constructs.

Mark Mitchell
(650) 331-3385 x713

More information about the Gcc mailing list