qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Greg Kurz <groug@kaod.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Eric Blake <eblake@redhat.com>,
	Howard Spoelstra <hsp.cat7@gmail.com>,
	qemu-ppc <qemu-ppc@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] ppc: e500: use g_strdup_printf() instead of snprintf()
Date: Mon, 4 Jun 2018 10:43:07 +1000	[thread overview]
Message-ID: <20180604004307.GD4251@umbus> (raw)
In-Reply-To: <CAFEAcA8bbdzEPZLA1sTXH-eGeOPUZw8f=p3_a9c4ERq35+mDew@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1821 bytes --]

On Tue, May 08, 2018 at 12:01:59PM +0100, Peter Maydell wrote:
> On 8 May 2018 at 10:34, Greg Kurz <groug@kaod.org> wrote:
> > On Mon, 7 May 2018 12:53:45 -0500
> > Eric Blake <eblake@redhat.com> wrote:
> >
> >> 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>
> >>
> >
> > Hi Peter,
> >
> > David said the next pull request for ppc would happen in a month. This
> > patch fixes an annoying build break with recent GCC, and it already
> > got two positive reviews, is it possible to have it merged upstream ?
> 
> Sure; applied to master.

Thanks!

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2018-06-04  1:20 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
2018-05-08  9:34   ` Greg Kurz
2018-05-08 11:01     ` Peter Maydell
2018-06-04  0:43       ` David Gibson [this message]

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=20180604004307.GD4251@umbus \
    --to=david@gibson.dropbear.id.au \
    --cc=eblake@redhat.com \
    --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).