On 9/2/25 23:20, Philippe Mathieu-Daudé wrote:
On 9/2/25 19:53, Philippe Mathieu-Daudé wrote:
On 9/2/25 19:44, Philippe Mathieu-Daudé wrote:
On 6/2/25 22:16, Richard Henderson wrote:

It would be nice if this were const, i.e.

   .class_data = (void *) &(const RISCVCPUDef){
       ...
   },

This will in fact create an anonymous object in .rodata.

We have other uses that do the extra casting away const,
e.g. armsse_variants in hw/arm/armsse.c.  Although I suspect
*all* usage of .class_init can and should be with const data.

The only non-const use I noticed is Xtensa:

Also the object_class_foreach() callbacks update 'data':

Oops I misread, object_class_foreach() correctly takes non-const data :)


Reply via email to