How to set the size of enums to 32 bits with arm-gcc without using -fno-short-enums


I need to fix the size of enums in arm-gcc (plain C, standard 99, not C++) to 32 bits. I don't want to use -fno-short-enums because it generates a warning because of other libraries I'm linking against.

I have tried __attribute__((packed)) and #pragma pack(4) and none of them work.

Is there any way to achieve this, apart from adding a enum constant like __MAKE_4_BYTES = 0xFFFFFFFF?

asked on Stack Overflow Jan 13, 2020 by Dan • edited Jan 14, 2020 by Dan

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0