Created attachment 375452 [details, diff]
4.9 adds support for color-highlighted warnings with the -fdiagnostics-color flag. Because portage includes escape characters in build logs (bug #496816) we end up with crap like:
^[[01m^[[K/var/tmp/portage/app-office/calligra-2.7.5/work/calligra-2.7.5/kexi/plugins/forms/widgets/kexidbimagebox.cpp:903:49:^[[m^[[K ^[[01;33m^[[Kwarning: ^[[m^[[K'^[[01m^[[Kconst QColor& QColorGroup::base() const^[[m^[[K' is deprecated (declared at ^[[01m^[[K/usr/include/qt4/QtGui/qpalette.h:234^[[m^[[K) [-Wdeprecated-declarations]
In addition to being completely unreadable this breaks all our QA rules for flagging compiler warnings.
While I was poking around in here I converted a few of the rules to match the -W flag name rather than the warning message itself. This should make it a little more future-proof.
Tested by building zsnes with and without -fdiagnostics-color.
I can confirm that gcc-4.7 spits those -W flags in QA warnings too. I guess we could just switch to that.
Created attachment 384614 [details, diff]
Thanks for the patch. Here's my update to it. I've switched a few more to either -Wfoo or combination of -Wfoo and a keyword. Also added comments for what each check does.
I've tested it with 4.9&4.8. I'm going to test 4.7&4.6 when I build them too. I doubt we need to support earlier versions.
Thanks, this looks good. I just checked 4.7. Anything before that we can ignore.
I guess so. 4.6 doesn't even compile :).
Everyone marking 4.6.4 stable seem to disagree.
(In reply to Michał Górny from comment #2)
if it matches gcc-4.7 and newer, then sounds good to me. i don't mind dropping support in this area for older versions (same as hardening).
Fix applied and Released in portage-2.2.14_rc1
A bit off-topic but not worth opening a new bug:
+ # left/right-hand operand of comma expression has no effect
+ "warning: .*comma.*\\[-Wunused-value\\]"
With 4.9 and later the "right-hand" version of this warning gets triggered by a large number of packages, including binutils, glibc, and gcc itself. It's very noisy; I'm seeing it occur on some packages 30-50 times. I looked into it a while back and IIUC it can be caused when the RHS of a comma expression is a macro that supplies a return value which is not used by the caller), which seems to be a relatively common practice. In any case I think this warning is pretty harmless, or at least doesn't fall into "severe warnings that may exhibit random runtime failures" territory, and the large number of warnings generated may drown out more important messages.
So, can we limit this to "left-hand" please?
(In reply to Ryan Hill from comment #8)
> A bit off-topic but not worth opening a new bug:
> + # left/right-hand operand of comma expression has no effect
> + "warning: .*comma.*\\[-Wunused-value\\]"
> So, can we limit this to "left-hand" please?
Like this then?
"warning: .*left-hand operand of comma.*\\[-Wunused-value\\]"
Pushed this commit:
which should fix this.
This is fixed in 2.2.14.