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: Using C++ in GCC is OK


Richard Earnshaw wrote:

>> I think virtual functions are on the edge; quite useful, but do result
>> in the compiler adding a pointer to data objects and in uninlinable
>> indirect calls at run-time.  Therefore, I would avoid them in the
>> initial subset of C++ used in GCC.
> 
> We do, of course, have one very big 'virtual function' table in gcc --
> namely the target hooks.  It would be a shame if that couldn't be made
> into a proper class with virtual functions by some arbitrary rule --
> it's a perfect example of when they should be considered.

Ian has bravely taken on the task of C++ coding standards and he's more
liberal than I am with respect to the subset to use.  (That suits me
fine, since I like virtual functions fine, and now I don't have to feel
guilty about stuffing them down anybody's throat.)  So, anyhow, it looks
to me as if current consensus is trending in the direction you suggest...

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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