gcc -Woverloaded-virtual

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


On Monday 26 November 2007, Hans Meine wrote:
> Am Montag, 26. November 2007 18:23:17 schrieb Thomas McGuire:
> > > I would like to have the warning enabled by default so that I'm not the
> > > only one getting those. OTOH I fully understand that this can be very
> > > annoying when working on an application and you don't want to look into
> > > silencing the warnings (or fixing the bugs) in libs or whereever the
> > > header comes from.
> >
> > It it not only the libs, it is also that some GCC warnings are unnecessary,
> > see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423 .
> 
> The warnings are not "unnecessary" in general.  It's just that there are two 
> use cases for the flag, so it should be probably split up (and the more 
> important one should become included in -Wall), as suggested by the reporter 
> in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423#c2 .

In addition, if only gcc would implement http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17920 
" add __attribute__((reimpl)) as a replacement for the (optional) virtual keyword for reimplementations of virtual functions"
then we could detect wrong signatures in methods that are meant to reimplement a virtual method, in a much better way.

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