qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ppc: e500: use g_strdup_printf() instead of snp


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH] ppc: e500: use g_strdup_printf() instead of snprintf()
Date: Mon, 4 Jun 2018 10:43:07 +1000
User-agent: Mutt/1.9.5 (2018-04-13)

On Tue, May 08, 2018 at 12:01:59PM +0100, Peter Maydell wrote:
> On 8 May 2018 at 10:34, Greg Kurz <address@hidden> wrote:
> > On Mon, 7 May 2018 12:53:45 -0500
> > Eric Blake <address@hidden> 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: ‘/address@hidden
> >> > 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/address@hidden", 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 <address@hidden>
> >> > Signed-off-by: Greg Kurz <address@hidden>
> >> > ---
> >> >   hw/ppc/e500.c |   39 +++++++++++++++++++++++----------------
> >> >   1 file changed, 23 insertions(+), 16 deletions(-)
> >> >
> >>
> >> Reviewed-by: Eric Blake <address@hidden>
> >>
> >
> > 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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]