qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	qemu-devel@nongnu.org, qemu-s390x <qemu-s390x@nongnu.org>
Subject: Re: compile warning in i8259.c
Date: Mon, 15 Mar 2021 16:58:06 +0100	[thread overview]
Message-ID: <b599711f-b1ab-5156-bfe6-ed49edd9423b@redhat.com> (raw)
In-Reply-To: <d897bc68-a2c9-0826-76a6-93a9682ae4ad@redhat.com>

On 15/03/2021 16.50, Philippe Mathieu-Daudé wrote:
> On 3/15/21 4:42 PM, Thomas Huth wrote:
>> On 15/03/2021 16.14, Christian Borntraeger wrote:
>>> For some time now I do see the following, when I compile x86-softmmu
>>> on s390:
>>>
>>> FAILED: libcommon.fa.p/hw_intc_i8259.c.o
>>> cc -Ilibcommon.fa.p -I. -I.. -Iqapi -Itrace -Iui -Iui/shader
>>> -I/usr/include/capstone -I/usr/include/glib-2.0
>>> -I/usr/lib64/glib-2.0/include -I/usr/include/libmount
>>> -I/usr/include/blkid -I/usr/include/gio-unix-2.0
>>> -I/usr/include/libusb-1.0 -I/usr/include/vte-2.91
>>> -I/usr/include/pango-1.0 -I/usr/include/harfbuzz
>>> -I/usr/include/freetype2 -I/usr/include/libpng16
>>> -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo
>>> -I/usr/include/pixman-1 -I/usr/include/gtk-3.0
>>> -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0
>>> -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0
>>> -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0
>>> -I/usr/include/virgl -I/usr/include/p11-kit-1 -I/usr/include/SDL2
>>> -I/usr/include/cacard -I/usr/include/nss3 -I/usr/include/nspr4
>>> -I/usr/include/slirp -fdiagnostics-color=auto -pipe -Wall
>>> -Winvalid-pch -Werror -std=gnu99 -O2 -g -isystem
>>> /home/cborntra/REPOS/qemu/linux-headers -isystem linux-headers -iquote
>>> . -iquote /home/cborntra/REPOS/qemu -iquote
>>> /home/cborntra/REPOS/qemu/include -iquote
>>> /home/cborntra/REPOS/qemu/disas/libvixl -iquote
>>> /home/cborntra/REPOS/qemu/tcg/s390 -iquote
>>> /home/cborntra/REPOS/qemu/accel/tcg -pthread -U_FORTIFY_SOURCE
>>> -D_FORTIFY_SOURCE=2 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
>>> -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef
>>> -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common
>>> -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits
>>> -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
>>> -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined
>>> -Wimplicit-fallthrough=2 -Wno-missing-include-dirs
>>> -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIC
>>> -DSTRUCT_IOVEC_DEFINED -D_REENTRANT -Wno-undef -D_DEFAULT_SOURCE
>>> -D_XOPEN_SOURCE=600 -DNCURSES_WIDECHAR -MD -MQ
>>> libcommon.fa.p/hw_intc_i8259.c.o -MF
>>> libcommon.fa.p/hw_intc_i8259.c.o.d -o libcommon.fa.p/hw_intc_i8259.c.o
>>> -c ../hw/intc/i8259.c
>>> ../hw/intc/i8259.c: In function ‘pic_read_irq’:
>>> ../hw/intc/i8259.c:203:13: error: ‘irq2’ may be used uninitialized in
>>> this function [-Werror=maybe-uninitialized]
>>>     203 |         irq = irq2 + 8;
>>>         |         ~~~~^~~~~~~~~~
>>> cc1: all warnings being treated as errors
>>>
>>> Due to other compile warnings I find this hard to bisect. Has anyone
>>> seen this as well?
>>
>> I've never seen this warnings so far... which compiler version is this?
>> Looking at the code, it seems to be a false positive to me.
> 
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg599522.html

Oh, well, I completely forgot about that one ... but that was with -O3 ... 
interesting that it now occurs with -O2, too!

But even after staring at the code for a while, I cannot see how irq2 may 
not be initialized here ... so this really rather sounds like a compiler bug 
to me... anyway, we could simply silence it by pre-initializing the variable 
to -1 or so?

  Thomas



  reply	other threads:[~2021-03-15 15:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 15:14 compile warning in i8259.c Christian Borntraeger
2021-03-15 15:42 ` Thomas Huth
2021-03-15 15:46   ` Christian Borntraeger
2021-03-15 15:50   ` Philippe Mathieu-Daudé
2021-03-15 15:58     ` Thomas Huth [this message]
2021-03-15 16:15       ` Christian Borntraeger
2021-03-15 15:44 ` Christian Borntraeger
2021-03-15 15:55   ` Philippe Mathieu-Daudé
2021-03-15 16:43     ` Paolo Bonzini
2021-03-15 16:20   ` Thomas Huth
2021-03-15 16:27     ` Richard Henderson
2021-03-15 16:27     ` Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b599711f-b1ab-5156-bfe6-ed49edd9423b@redhat.com \
    --to=thuth@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).