All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ?
@ 2016-05-03 15:58 dcb
  2016-05-03 18:11 ` Stefan Weil
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: dcb @ 2016-05-03 15:58 UTC (permalink / raw)
  To: qemu-devel

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

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1577841

Title:
  target-mips/helper.c:542: bad sizeof ?

Status in QEMU:
  New

Bug description:
  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));

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1577841/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ?
  2016-05-03 15:58 [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ? dcb
@ 2016-05-03 18:11 ` Stefan Weil
  2016-05-03 21:11   ` Aurelien Jarno
  2016-05-27  7:24 ` [Qemu-devel] [Bug 1577841] " T. Huth
  2016-09-02 21:07 ` T. Huth
  2 siblings, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2016-05-03 18:11 UTC (permalink / raw)
  To: Bug 1577841, qemu-devel, Aurelien Jarno

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));

(this corresponds to your suggested code)

Regards
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ?
  2016-05-03 18:11 ` Stefan Weil
@ 2016-05-03 21:11   ` Aurelien Jarno
  2016-05-03 21:41     ` Stefan Weil
  0 siblings, 1 reply; 6+ messages in thread
From: Aurelien Jarno @ 2016-05-03 21:11 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Bug 1577841, qemu-devel

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

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ?
  2016-05-03 21:11   ` Aurelien Jarno
@ 2016-05-03 21:41     ` Stefan Weil
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Weil @ 2016-05-03 21:41 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: Bug 1577841, qemu-devel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1577841] Re: target-mips/helper.c:542: bad sizeof ?
  2016-05-03 15:58 [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ? dcb
  2016-05-03 18:11 ` Stefan Weil
@ 2016-05-27  7:24 ` T. Huth
  2016-09-02 21:07 ` T. Huth
  2 siblings, 0 replies; 6+ messages in thread
From: T. Huth @ 2016-05-27  7:24 UTC (permalink / raw)
  To: qemu-devel

Fix has been included here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=9d989c732b153fe15

** Changed in: qemu
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1577841

Title:
  target-mips/helper.c:542: bad sizeof ?

Status in QEMU:
  Fix Committed

Bug description:
  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));

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1577841/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1577841] Re: target-mips/helper.c:542: bad sizeof ?
  2016-05-03 15:58 [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ? dcb
  2016-05-03 18:11 ` Stefan Weil
  2016-05-27  7:24 ` [Qemu-devel] [Bug 1577841] " T. Huth
@ 2016-09-02 21:07 ` T. Huth
  2 siblings, 0 replies; 6+ messages in thread
From: T. Huth @ 2016-09-02 21:07 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1577841

Title:
  target-mips/helper.c:542: bad sizeof ?

Status in QEMU:
  Fix Released

Bug description:
  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));

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1577841/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-02 21:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03 15:58 [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ? dcb
2016-05-03 18:11 ` Stefan Weil
2016-05-03 21:11   ` Aurelien Jarno
2016-05-03 21:41     ` Stefan Weil
2016-05-27  7:24 ` [Qemu-devel] [Bug 1577841] " T. Huth
2016-09-02 21:07 ` T. Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.