blob: 6bfff2ee0b6028c008d0c3c3700156ca70b630ea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
device: 0.950
performance: 0.805
socket: 0.748
network: 0.742
semantic: 0.691
vnc: 0.651
PID: 0.634
other: 0.593
files: 0.587
graphic: 0.563
permissions: 0.538
boot: 0.486
debug: 0.443
KVM: 0.350
hw/timer/altera_timer.c:207: bad size in memset ?
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));
On 28 January 2017 at 13:16, dcb <email address hidden> wrote:
> 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));
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
|