Peter Maydell <[email protected]> writes:

> On 24 April 2018 at 13:18, Markus Armbruster <[email protected]> wrote:
>> We define hundreds of QOM types without ever bothering to check the
>> super type comes first.  We don't even bother to clearly document it has
>> to come first.
>
> If you don't put the super type first then the first time you
> do MyParent *p = MY_PARENT(me); then the QOM cast will assert
> on you, so you'll figure it out pretty quickly...

Same for QObject & friends, where qobject_to() asserts.

Marc-André's argument for adding more checks was the possibility of
someone doing MyParent *p = (MyParent *)me without running into
MY_PARENT(me).

Reply via email to