On Tue, Feb 09, 2016 at 12:07:43PM +0100, Michal Privoznik wrote:
Dear list,
I've noticed a failed build on CentOS-6 after some commits. Problem was
that old gcc is not wise enough and produces a false positive.
Actually, gcc is doing exactly what we told it todo. We include
-Wmaybe-uninitialized in the warning flags, which tells gcc to
report warnings for uninitialized variables even if it is not
entirely sure it is correct.
If we happen to stop caring we probably should stop our CentOS-6
build
in jenkins too [2].
The warning message shown here is actually slightly mis-leading
"domain_conf.c:21475: error: 'priority' may be used uninitialized in this
function [-Wuninitialized]"
Notice that the message string says "may be used", not "is used".
This
indicates that gcc was unsure about the situation, but reported it
anyway. The '[-Wuninitialized]' suffix is a horribly misleading bug
in gcc 4.x - it should be saying '[-Wmaybe-uninitialized]' but that
version of gcc didn't distinguish the two options when reporting the
warning message :-(
So a valid fix arguably could be to remove use of -Wmaybe-uninitialized
flag, and only rely on -Wuninitialized where gcc is 100% certain.
Personally though, I'm in favour of keeping -Wmaybe-uninitialized since
some of the things reported by that will be genuine bugs, and it is
easy enough for us to silence the false positives by simply initializing
the variables when needed.
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|