qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Greg Kurz <groug@kaod.org>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Howard Spoelstra <hsp.cat7@gmail.com>,
	qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH] ppc: e500: use g_strdup_printf() instead of snprintf()
Date: Mon, 7 May 2018 12:53:45 -0500	[thread overview]
Message-ID: <71b68bd5-e50b-3baa-3f72-f6af78db4e2e@redhat.com> (raw)
In-Reply-To: <152568372989.443627.900708381919207053.stgit@bahia.lan>

On 05/07/2018 04:02 AM, Greg Kurz wrote:
> qemu-system-ppc fails to build with GCC 8.0.1:
> 
> /home/hsp/src/qemu-master/hw/ppc/e500.c: In function ‘ppce500_load_device_tree’:
> /home/hsp/src/qemu-master/hw/ppc/e500.c:442:37: error: ‘/pic@’
> directive output may be truncated writing 5 bytes into a region of
> size between 1 and 128 [-Werror=format-truncation=]
>       snprintf(mpic, sizeof(mpic), "%s/pic@%llx", soc, MPC8544_MPIC_REGS_OFFSET);
>                                       ^~~~~

> 
> Fix this by converting e500 to use g_strdup_printf()+g_free() instead
> of snprintf(). This is done globally, even for call sites that don't
> break build, since this is the preferred practice in QEMU.
> 
> Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>   hw/ppc/e500.c |   39 +++++++++++++++++++++++----------------
>   1 file changed, 23 insertions(+), 16 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

  reply	other threads:[~2018-05-07 17:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07  9:02 [Qemu-devel] [PATCH] ppc: e500: use g_strdup_printf() instead of snprintf() Greg Kurz
2018-05-07 17:53 ` Eric Blake [this message]
2018-05-08  9:34   ` Greg Kurz
2018-05-08 11:01     ` Peter Maydell
2018-06-04  0:43       ` David Gibson

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=71b68bd5-e50b-3baa-3f72-f6af78db4e2e@redhat.com \
    --to=eblake@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=hsp.cat7@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).