Hi Philippe, thank you for looking into my patch. On Thu, Jan 29, 2026 at 11:23 AM Philippe Mathieu-Daudé <[email protected]> wrote: > > On 29/1/26 20:04, Roman Kiryanov wrote: > > This patch fixes the C++ compilation error: > > > > ISO C++ forbids forward references to 'enum' types > > > > -typedef enum QKbdModifier QKbdModifier; > > - > > -enum QKbdModifier { > > +typedef enum QKbdModifier { > > -}; > > +} QKbdModifier; > > Yes but: > > $ git grep -E 'typedef enum.*;' > include/hw/misc/auxbus.h:32:typedef enum AUXCommand AUXCommand;
I also grepped through the QEMU source code and saw other examples. I limited this patch to ui/kbd-state.h because it is the specific header causing C++ compilation errors in our project. I hesitated to touch the others to keep the diff minimal and avoid changes in files we aren't currently using. Currently, QEMU has a mix of incompatible and compatible (e.g. block/block-common.h, BlockZoneOp) enum definitions. I think, everything outside the include/ directory should be implementation details. How would you prefer I proceed? 1) Keep this patch focused: Limit the change to kbd-state.h to fix the active build breakage. 2) Fix public headers: I can send a v2 that fixes this pattern for all files in include/. 3) Tree-wide cleanup: I can attempt to fix every instance found by grep, though this touches private headers as well. > 2/ add a CI job to ensure no more are added Regarding CI: Since our project consumes QEMU headers in a C++ environment, we are effectively serving as a test case for this. We are happy to continue submitting patches as we encounter these compatibility issues.
