qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [Qemu-devel] [PATCH] ppc: e500: use g_strdup_printf() ins


From: Peter Maydell
Subject: Re: [Qemu-ppc] [Qemu-devel] [PATCH] ppc: e500: use g_strdup_printf() instead of snprintf()
Date: Tue, 8 May 2018 12:01:59 +0100

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.

-- PMM



reply via email to

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