[ARM] EABI and the default to short enums
Ian Lance Taylor
iant@google.com
Tue Feb 14 15:27:00 GMT 2012
Sebastian Huber <sebastian.huber@embedded-brains.de> writes:
> the default ARM EABI configuration uses short enums by default (from
> "gcc/config/arm/arm.c":
>
> /* AAPCS based ABIs use short enums by default. */
>
> static bool
> arm_default_short_enums (void)
> {
> return TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX;
> }
>
> This causes a major headache for me since some libraries assume that
> sizeof(any enum) > 1, e.g. the standard XDR library. Is the only
> possible way to disable short enums to set the ABI to
> ARM_ABI_AAPCS_LINUX? Which side effects does this have?
This question would be better asked on the mailing list
gcc-help@gcc.gnu.org rather than gcc@gcc.gnu.org. The gcc@ mailing list
is for issues related to the development of gcc itself. Please take any
followups to gcc-help. Thanks.
You can use -fno-short-enums. However, see the note about ABI
compatibility in the -fshort-enums doc.
Ian
More information about the Gcc
mailing list