Il 15/02/2013 14:48, Peter Maydell ha scritto: >>> >> If you prefer we could standardize on >>> >> typedef struct { >>> >> ParentClass parent; >>> >> } FooClass; >>> >> >>> >> rather than typedef ParentClass FooClass; >> > It may need rework either way. Because aliasing via typedef gives >> > FooClass fields it will loose once it is turned into a real QOM class. >> > We had such an issue with i440fx in my PHB series, that's why I'm >> > sensitive to it. ;) > OK, so that seems like an argument for always defining the > empty-except-for-the-parentclass class struct, or does that > run into problems too?
I like the empty-except-for-parentclass. OTOH, if you have no fields you will not use FOO_CLASS. You will only use PARENT_CLASS, and those uses will be fine even after you start having a FooClass. So, having no typedef and no _CLASS macros at all is simple and should be acceptable. But if you have a typedef, you should a) make it a struct, b) add the _CLASS macros. Paolo