On 3/27/23 15:52, Richard Henderson wrote:
On 3/27/23 05:42, Daniel Henrique Barboza wrote:
+static void cpu_set_misa_ext_cfg(Object *obj, Visitor *v, const char *name,
+ void *opaque, Error **errp)
+{
+ RISCVCPUMisaExtConfig *misa_ext_cfg = opaque;
const
+static void cpu_get_misa_ext_cfg(Object *obj, Visitor *v, const char *name,
+ void *opaque, Error **errp)
+{
+ RISCVCPUMisaExtConfig *misa_ext_cfg = opaque;
const
+static RISCVCPUMisaExtConfig misa_ext_cfgs[] = {};
const
It seems that I can't use 'const' because the object_property_add() API uses a
'void *opaque'
pointer and it won't take a "const RISCVCPUMisaExtConfig *":
../target/riscv/cpu.c:1454:35: error: passing argument 7 of
‘object_property_add’ discards ‘const’ qualifier from pointer target type
[-Werror=discarded-qualifiers]
1454 | NULL, misa_cfg);
| ^~~~~~~~
In file included from /home/danielhb/work/qemu/include/hw/qdev-core.h:8,
from /home/danielhb/work/qemu/include/hw/core/cpu.h:23,
from ../target/riscv/cpu.h:23,
from ../target/riscv/cpu.c:24:
/home/danielhb/work/qemu/include/qom/object.h:1067:43: note: expected ‘void *’
but argument is of type ‘const RISCVCPUMisaExtConfig *’
1067 | void *opaque);
Daniel
r~