blob: 8a696ab7d1812c92bbf52e8f91bfcf4804e48374 (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
debug: 0.801
hypervisor: 0.800
register: 0.793
permissions: 0.791
PID: 0.766
risc-v: 0.763
arm: 0.758
TCG: 0.756
network: 0.731
architecture: 0.730
user-level: 0.726
performance: 0.725
graphic: 0.705
VMM: 0.686
virtual: 0.672
ppc: 0.646
mistranslation: 0.630
assembly: 0.629
x86: 0.598
semantic: 0.595
vnc: 0.591
device: 0.584
peripherals: 0.580
KVM: 0.533
boot: 0.507
socket: 0.489
files: 0.487
kernel: 0.416
i386: 0.299
contrib/plugins/execlog.c: warning: passing argument 2 of ‘g_ptr_array_add’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
Description of problem:
Hit some warning messages when compiling upstream qemu
Steps to reproduce:
1. Clone repo and compile it
1.1 git clone https://gitlab.com/qemu-project/qemu.git
1.2 mkdir build
1.3 cd build/
1.4 ../configure --target-list=x86_64-softmmu --enable-debug-info
1.5 make
2. It will print the following warning messages:
```
[2767/2767] Linking target tests/qtest/netdev-socket
/root/qemu/contrib/plugins/execlog.c: In function ‘registers_init’:
/root/qemu/contrib/plugins/execlog.c:339:63: warning: passing argument 2 of ‘g_ptr_array_add’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
339 | g_ptr_array_add(all_reg_names, reg->name);
| ~~~^~~~~~
In file included from /usr/include/glib-2.0/glib.h:31,
from /root/qemu/contrib/plugins/execlog.c:9:
/usr/include/glib-2.0/glib/garray.h:192:62: note: expected ‘gpointer’ {aka ‘void *’} but argument is of type ‘const char *’
192 | gpointer data);
| ~~~~~~~~~~~~~~~~~~^~~~
```
Additional information:
1. After Eugenio Perez Martin (eperezma@redhat.com) debug, we found this problem introduced by this commit:
```
commit af6e4e0a22c18a7cc97650caec56ed99c9899dd7
Author: Alex Bennée <alex.bennee@linaro.org>
Date: Tue Feb 27 14:43:32 2024 +0000
contrib/plugins: extend execlog to track register changes
```
2. The latest commit in my env:
```
commit db596ae19040574e41d086e78469014191d7d7fc (origin/staging, origin/master, origin/HEAD)
Merge: 7d4e29ef80 7558300c53
Author: Peter Maydell <peter.maydell@linaro.org>
Date: Tue Mar 5 13:54:54 2024 +0000
Merge tag 'pull-target-arm-20240305' of https://git.linaro.org/people/pmaydell/qemu-arm into staging
target-arm queue:
* raspi: Implement Broadcom Serial Controller (BSC) for BCM2835 boards
* hw/char/pl011: Add support for loopback
* STM32L4x5: Implement RCC clock control device
* target/arm: Do memory type alignment checks
* atomic.h: Reword confusing comment for qatomic_cmpxchg
* qemu-options.hx: Don't claim "-serial" has limit of 4 serial ports
```
|