From: "Daniel P. Berrange" <berrange@redhat.com>
To: Eduardo Otubo <otubo@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] configure: add -Wno-format-truncation to QEMU_CFLAGS
Date: Thu, 20 Jul 2017 16:33:28 +0100 [thread overview]
Message-ID: <20170720153328.GN21566@redhat.com> (raw)
In-Reply-To: <20170720145729.22141-1-otubo@redhat.com>
On Thu, Jul 20, 2017 at 04:57:29PM +0200, Eduardo Otubo wrote:
> Compilation breaks on GCC 7.1.1 20170622 (Fedora 26), thus adding
> -Wno-format-truncation to QEMU_CFLAGS on configure script is neecssary.
>
> hw/usb/bus.c: In function ‘usb_port_location’:
> hw/usb/bus.c:410:66: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 0 and 15 [-Werror=format-truncation=]
> snprintf(downstream->path, sizeof(downstream->path), "%s.%d",
> ^~
> In file included from /usr/include/stdio.h:939:0,
> from /home/otubo/develop/qemu/otubo/include/qemu/osdep.h:68,
> from hw/usb/bus.c:1:
> /usr/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 3 and 28 bytes into a destination of size 16
> return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> __bos (__s), __fmt, __va_arg_pack ());
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make: *** [/home/otubo/develop/qemu/otubo/rules.mak:66: hw/usb/bus.o] Error 1
> make: *** Waiting for unfinished jobs....
>
> Signed-off-by: Eduardo Otubo <otubo@redhat.com>
> ---
> This warning looks pretty much bogus to me. Since building with -Werror is
> essential, we should add this flag to configure. If someone thinks this warning
> is not a false positive, feel free to drop this patch.
This particular case of the warning may be a false positive, but the
-Wformat-truncation warning *can* detect serious real bugs so turning
it off is not appropriate. In any case there's a patch this problem
queued for merge already:
https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg06455.html
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2017-07-20 15:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 14:57 [Qemu-devel] [PATCH] configure: add -Wno-format-truncation to QEMU_CFLAGS Eduardo Otubo
2017-07-20 15:23 ` no-reply
2017-07-20 15:33 ` Daniel P. Berrange [this message]
2017-07-20 16:02 ` Eduardo Otubo
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=20170720153328.GN21566@redhat.com \
--to=berrange@redhat.com \
--cc=otubo@redhat.com \
--cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.