[RFC] Switching implementation language to C++

Gabriel Dos Reis gdr@integrable-solutions.net
Mon May 31 18:51:00 GMT 2010

On Mon, May 31, 2010 at 1:25 PM, Mark Mitchell <mark@codesourcery.com> wrote:
> 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.

Yes, this is the sort of issues I have in mind.  For example, I do not see how
we can use C++ in tree.h without requiring other front-ends to use C++, at least
for the parts that use tree.h.  By components, I meant "for example, is it the
case that the C++ front-end would use C++, but with sufficient care
that it can be
linked with  the common C codes if the C front-end is not using C++?".

-- Gaby

More information about the Gcc mailing list