On Thu, Jun 20, 2024 at 8:14 PM Richard Henderson <richard.hender...@linaro.org> wrote: > > On 6/20/24 11:06, Paolo Bonzini wrote: > > On 6/19/24 00:46, Roman Kiryanov wrote: > >> void* pointer arithmetic is not in the > >> C standard. This change allows using > >> the QEMU headers with a C++ compiler. > >> > >> Google-Bug-Id: 331190993 > >> Change-Id: I5a064853429f627c17a9213910811dea4ced6174 > >> Signed-off-by: Roman Kiryanov <r...@google.com> > > > > Would it work instead to declare MemoryRegionCache's ptr field as char*? > > I prefer to use char* only where there are strings. For unstructured data > such as > MemoryRegionCache, void* is more appropriate.
Or uint8_t*... I agree about char*, but unless casts are needed, I find uint8_t and void pointers to be more or less interchangeable. The problem is that casts are a bit uglier and (while unlikely in this particular case) more subject to bit rot. Paolo