2.1.107. --[un]signed_bitfields

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

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential