8.169 --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.


The default is --unsigned_bitfields. However, if you specify an ARM Linux configuration file on the command line and you use --translate_gcc or --translate_g++, the default is --signed_bitfields.


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


typedef int integer;
    integer x : 1;
} bf;

Compiling this code with --signed_bitfields causes xto be treated as a signed bitfield.

Related reference
8.9 --arm_linux_config_file=path
8.10 --arm_linux_configure
8.92 --gnu_defaults
Related information
Procedure Call Standard for the ARM Architecture
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.