[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeo
From: |
Stefan Weil |
Subject: |
Re: [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ? |
Date: |
Tue, 3 May 2016 23:41:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0 |
Am 03.05.2016 um 23:11 schrieb Aurelien Jarno:
> On 2016-05-03 20:11, Stefan Weil wrote:
>> Am 03.05.2016 um 17:58 schrieb dcb:
>>> Public bug reported:
>>>
>>> Recent versions of gcc say this:
>>>
>>> qemu/target-mips/helper.c:542:9: warning: ‘memset’ used with length
>>> equal to number of elements without multiplication by element size
>>> [-Wmemset-elt-size]
>>>
>>> Source code is
>>>
>>> memset(env->CP0_WatchLo, 0, sizeof(*env->CP0_WatchLo));
>>>
>>> Maybe better code
>>>
>>> memset(env->CP0_WatchLo, 0, 8 * sizeof(target_ulong));
>>>
>>> ** Affects: qemu
>>> Importance: Undecided
>>> Status: New
>>
>> This might be an error. I think it should be
>>
>> memset(env->CP0_WatchLo, 0, sizeof(env->CP0_WatchLo));
>>
>
> I confirm this is the correct version of the code. Someone is sending a
> patch, i should I do that?
>
> Aurelien
Yes, that would be nice. I don't think the patch is needed for 2.6 as
this code is rather old, so it is sufficient to fix it in the next version.
Thanks,
Stefan