gcc -Woverloaded-virtual

David Faure faure at kde.org
Tue Nov 27 11:48:53 GMT 2007


On Tuesday 27 November 2007, Aurélien Gâteau wrote:
> David Faure wrote:
> 
> >> Adding a new virtual method to a class is not binary compatible, but
> >> reimplementing an existing virtual method is binary compatible, or am I
> >> wrong? In this case we don't need to keep the method.
> > 
> > It's BC but old programs that haven't been recompiled will not call the
> > reimplementation if we re-add it later.
> > So I would rather leave it, for symmetry with addSubjob being
> > reimplemented.
> 
> This is true if the program instantiates the class itself, but in the case
> of jobs, they are instantiated by the kio libraries, so I guess the job
> instances would always have up-to-date virtual tables.

Well, I was thinking about jobs implemented out of kdelibs, e.g. KMail has imap-related
jobs that derive from KIO::Job, KIO::SpecialJob, etc. and it does call addSubjob/removeSubjob.

> On the other hand I see your point about keeping the symetry. And you know
> this code much better than me, so it's your decision.
> 
> I can commit the second version of my patch if you want, but I don't feel
> like doing the other changes we discussed myself, because I don't have a
> complete KDE checkout.

I'll do it then, no problem.
Thanks for the fruitful discussion, was more effort than the actual code changes :-)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list