This is the mail archive of the 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: Using C++ in GCC is OK

On Mon, 31 May 2010, Ian Lance Taylor wrote:

> I have written a proposed set of C++ coding conventions on the wiki at
> This is only a preliminary proposal.  It requires fleshing out and
> discussion.  Comments welcome.

I think the coding style warning option is an important piece to get in 
early before many C++ changes are made.

I propose GCC 4.1 as the baseline GCC version that should be able to build 
versions of GCC built as C++.  (PPL requires at least 4.0 so anyone 
building a Graphite-enabled compiler will have a 4.0 or later C++ compiler 
for the host, and 4.1 was more widely used than 4.0.)

In addition to what I said about avoiding any bulk changes to formatting 
conventions, I think there should be a principle that changes of existing 
code to use C++ features should generally improve the maintainability and 
comprehensibility of the code.  Conversion to standard C++ features where 
macros are used to emulate e.g. templates (STL or otherwise) or 
inheritance is much more desirable than converting qsort calls to 
std::sort since qsort is a well-understood standard C feature rather than 
a pile of GCC-specific macros.

I repeat my request from the RM Q&A for a guide for reviewers on how to 
detect hidden overhead in the presence of C++ features.  When will a 
structure/class/union be larger than might be expected in C?  When will 
C++ statements involve runtime overhead that might not be expected from 
equivalent C statements?

Joseph S. Myers

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