gcc -Woverloaded-virtual

David Faure faure at kde.org
Mon Nov 26 18:20:03 GMT 2007


On Monday 26 November 2007, André Wöbbeking wrote:
> On Monday 26 November 2007, David Faure wrote:
> > On Monday 26 November 2007, Aurélien Gâteau wrote:
> > > David Faure wrote:
> > > >> I am afraid this will lead to problems if one is overloaded and
> > > >> not the other.
> > > >
> > > > ... which is exactly what the -Woverloaded-virtual warning will
> > > > detect :-)
> > >
> > > I mean, what happens if addSubjob(KJob*) is overloaded, but not
> > > addSubjob(KJob*, bool)? I don't think -Woverloaded-virtual will
> > > notice any problem.
> >
> > Yes it will, it's exactly what the warning is about: reimplementing a
> > virtual method which has overloads and not reimplementing the
> > overloads.
> 
> Not really. AFAIK it's about broken reimplementation caused by wrong 
> signature. At least the base class doesn't need overloads of a virtual 
> method to trigger the warning.

OK OK, s/exactly what/one of the things that/ in my sentence :)

-- 
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