hw/timer/altera_timer.c:207: bad size in memset ?
Public bug reported:
hw/timer/altera_timer.c:207:5: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset- elt-size]
Source code is
memset(t->regs, 0, ARRAY_SIZE(t->regs));
Maybe better code
memset(t->regs, 0, R_MAX * sizeof( uint32_t));
** Affects: qemu
Importance: Undecided
Status: New
Signature · 25 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1660035
Title:
hw/timer/altera_timer.c:207: bad size in memset ?
Status in QEMU:
New
Bug description:
hw/timer/altera_timer.c:207:5: warning: ‘memset’ used with length
equal to number of elements without multiplication by element size
[-Wmemset-elt-size]
Source code is
memset(t->regs, 0, ARRAY_SIZE(t->regs));
Maybe better code
memset(t->regs, 0, R_MAX * sizeof( uint32_t));
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1660035/+subscriptionsQuoted 6 lines · dcb
Public bug reported:
hw/timer/altera_timer.c:207:5: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset- elt-size]
Quoted 7 lines
Source code is
memset(t->regs, 0, ARRAY_SIZE(t->regs));Maybe better code
memset(t->regs, 0, R_MAX * sizeof( uint32_t));
Better still -- just memset(t->regs, 0, sizeof(t->regs));
Chris, could you send a patch to fix this, please?
thanks
-- PMM
This problem should have been fixed with QEMU v2.10.0:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=cc16ee9d4ecec35ea04e
** Changed in: qemu
Status: New => Fix Released
Signature · 25 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1660035
Title:
hw/timer/altera_timer.c:207: bad size in memset ?
Status in QEMU:
Fix Released
Bug description:
hw/timer/altera_timer.c:207:5: warning: ‘memset’ used with length
equal to number of elements without multiplication by element size
[-Wmemset-elt-size]
Source code is
memset(t->regs, 0, ARRAY_SIZE(t->regs));
Maybe better code
memset(t->regs, 0, R_MAX * sizeof( uint32_t));
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1660035/+subscriptions