#2967 closed enhancement (fixed)

ARM: Change ABI to not use short enums

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: tool/gcc Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Whether enums are short or not is left open in the ARM EABI. On Linux and FreeBSD no short enums are used. Otherwise short enums are enabled by default.

Short enums may cause hard to find issues with 3rd party software, since the are quite unusual in general, e.g.

https://git.rtems.org/rtems-libbsd/commit/freebsd/include/rpc?id=9880635f2e642380b69b85e00271649b3a2fc2de

The data and structure layout may suddenly change in case enumeration values are added/removed. The benefit of short enums is probably not worth the trouble, since the packed compiler attribute can be used to individually make an enum short.

The reason for not choosing no short enums during the ARM EABI introduction was an issue with Newlib. This is addressed with the following patch:

https://sourceware.org/ml/newlib/2017/msg00238.html

Change History (6)

comment:1 Changed on 04/03/17 at 06:07:37 by Sebastian Huber

Owner: changed from joel.sherrill@… to Sebastian Huber
Status: newaccepted

comment:3 Changed on 04/07/17 at 07:19:04 by Sebastian Huber

GCC website update done (GCC 6.4 changes show up once released):

https://gcc.gnu.org/gcc-6/changes.html
https://gcc.gnu.org/gcc-7/changes.html

comment:4 Changed on 06/08/17 at 07:30:12 by Sebastian Huber

Resolution: fixed
Status: acceptedclosed

Fixed due to change to GCC 7.1.

comment:5 Changed on 10/10/17 at 05:58:26 by Sebastian Huber

Component: GCCtool/gcc

comment:6 Changed on 11/09/17 at 06:27:14 by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.