qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties(


From: Daniel Henrique Barboza
Subject: Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties()
Date: Mon, 27 Mar 2023 19:15:39 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0



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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]