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: Compiling GCC with g++: a report


Zack Weinberg wrote:
Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

[...]

The cast you're talking about is buried deep in XNEWVEC, XRESIZEVEC
and such.  It is not anything you'll find in the code directly.  So,
in fact we do not lose readability as you claim.


To be honest, I think XNEW* are less readable than bare xmalloc, and I
regret that I ever invented them.

Too late. :-)


We have adopted them, and people have started using them. Unlike you, I still think they're a good thing. More importantly, I think it would be a mistake to reopen this issue; I don't think the difference is terribly important, but not having the debate seems like a win. :-)

Things I consider correct coding, but outside the intersection of C90
and C++, include: not casting the return value of allocator functions;

See above.


not casting to void* when passing an arbitrary pointer to a function
that takes a void* parameter

That's not necessary in C++ either; the C++ difference is that you must cast "void *" to "int *" to call a function accepting an "int *"; not the opposite. Maybe that's what you meant?


unrestricted use of C++ keywords;
>
declaring structure fields with the same name as a structure tag in
scope.

I don't think we should be reverting patches that fall afoul of these last two, even if they break Gaby's build-with-a-C++-compiler builds. But, I would tend to accept patches from Gaby to fix such problems.


--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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