[PATCH INSTALLED]: delete some const shadow functions

Tom Tromey tromey@redhat.com
Sat Sep 1 20:50:00 GMT 2007


>>>>> "Kaveh" == Kaveh R GHAZI <ghazi@caip.rutgers.edu> writes:

>> Thanks!  But in my opinion there is no excuse for *any* "const_"
>> shadow function.  They must all disappear.  Even if it means removing
>> const_tree altogether.  It's just not worth the added complexity.

Kaveh> You keep saying complexity, like GCC developers are too ditzy
Kaveh> to figure this out.  Somehow they manage to understand shadow
Kaveh> checking macros.

I think the specific thing I dislike about the shadow functions is the
code duplication.  Every shadow function means that for a class of
changes there are two places that must be fixed.  Even when the
functions are adjacent this can sometimes be overlooked.  That said,
my "dislike" for this is pretty mild.

Kaveh> I'm trying my best to make everyone happy.

I wanted to address this but I'm not quite sure what to say...  I
think you've been doing good work, not just with this patch series but
over the previous years.

Kaveh> Me too, I prefer the const shadow functions.  When we start
Kaveh> using C++ in GCC sources I'll convert these to use function
Kaveh> overloading.

I love the "when" :-).  This seems like a situation where templates or
const member functions would be appropriate.

Tom



More information about the Gcc-patches mailing list