You copied the Doc URL to your clipboard.

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

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 x to be treated as a signed bitfield.

Was this page helpful? Yes No