This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [ARM] EABI and the default to short enums
- From: Ian Lance Taylor <iant at google dot com>
- To: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 14 Feb 2012 07:05:36 -0800
- Subject: Re: [ARM] EABI and the default to short enums
- References: <4F3A37C9.2000708@embedded-brains.de>
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