7.152 --signed_bitfields, --unsigned_bitfields

Makes bitfields of type int signed or unsigned.

The C Standard specifies that if the type specifier used in declaring a bitfield is either int, or a typedef name defined as int, then whether the bitfield is signed or unsigned is dependent on the implementation.

Default

The default is --unsigned_bitfields.

Note

The AAPCS requirement for bitfields to default to unsigned on ARM, is relaxed in version 2.03 of the standard.

Example

typedef int integer;
struct
{
    integer x : 1;
} bf;
Compiling this code with --signed_bitfields causes xto be treated as a signed bitfield.
Related information
Procedure Call Standard for the ARM Architecture
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.