Re: [Qemu-devel] [PATCH v9 12/37] qapi: Don't cast Enum* to int*

2016-01-21 Thread Markus Armbruster
Eric Blake writes: > On 01/20/2016 11:08 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> C compilers are allowed to represent enums as a smaller type >>> than int, if all enum values fit in the smaller type. There >>> are even compiler flags that force the use of this smaller >>> rep

Re: [Qemu-devel] [PATCH v9 12/37] qapi: Don't cast Enum* to int*

2016-01-20 Thread Eric Blake
On 01/20/2016 11:08 AM, Markus Armbruster wrote: > Eric Blake writes: > >> C compilers are allowed to represent enums as a smaller type >> than int, if all enum values fit in the smaller type. There >> are even compiler flags that force the use of this smaller >> representation, and using them c

Re: [Qemu-devel] [PATCH v9 12/37] qapi: Don't cast Enum* to int*

2016-01-20 Thread Markus Armbruster
Eric Blake writes: > C compilers are allowed to represent enums as a smaller type > than int, if all enum values fit in the smaller type. There > are even compiler flags that force the use of this smaller > representation, and using them changes the ABI of a binary. Suggest "although using them

[Qemu-devel] [PATCH v9 12/37] qapi: Don't cast Enum* to int*

2016-01-19 Thread Eric Blake
C compilers are allowed to represent enums as a smaller type than int, if all enum values fit in the smaller type. There are even compiler flags that force the use of this smaller representation, and using them changes the ABI of a binary. Therefore, our generated code for visit_type_ENUM() (for a