#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 Apr 3, 2017 at 6:07:37 AM by Sebastian Huber

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

comment:3 Changed on Apr 7, 2017 at 7:19:04 AM 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 Jun 8, 2017 at 7:30:12 AM by Sebastian Huber

Resolution: fixed
Status: acceptedclosed

Fixed due to change to GCC 7.1.

comment:5 Changed on Oct 10, 2017 at 5:58:26 AM by Sebastian Huber

Component: GCCtool/gcc

comment:6 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.