gcc -Woverloaded-virtual

Matthias Kretz kretz at kde.org
Wed Nov 21 14:08:28 GMT 2007


On Wednesday 21 November 2007, Dirk Mueller wrote:
> On Friday 16 November 2007, Allen Winter wrote:
> > Vir and I think we should add the gcc option -Woverloaded-virtual to the
> > CXXFLAGS. Can we do this?
>
> I don't think its a good idea to enable it. did you see the spam of
> warnings it causes, where 70% of them are false?

I've not looked at many of them yet. But for every one I've looked at I got 
the impression that if the warning would have been there from since the code 
was written it wouldn't look like it does now. I.e. the warnings show either 
bad style or a problem in the API that can result in unexpected behaviour.

Now I agree that there are many places where we can't do much about it. But 
still I believe new code should always take this warning into account. And to 
make life easier our headers should be clean wrt -Woverloaded-virtual if 
possible.

What about "using" statements to silence some warnings where applicable? They 
don't change anything wrt the resulting code, right? I remember that we had 
compiler issues with using at some point, do we still support compilers that 
don't like using?

> Much better is it to check for the coverity reports, since they have a much
> higher signal/noise ratio.

Coverity didn't didn't tell me about the issues I fixed since I enabled the 
warning...

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071121/67253dcd/attachment.sig>


More information about the kde-core-devel mailing list