Controls whether or not the compiler uses type-size reduction for bitfields.
-[no]bfield_reduce_type
-bfield_reduce_type
__BITFIELD_TYPE_SIZE_REDUCTION__
__BITFIELD_NO_TYPE_SIZE_REDUCTION__
Type-size reduction means that the compiler can reduce the type of a bitfield from int to char if that bitfield fits into a character. Thus, memory will be allocated for a byte instead of an integer.
This option is equivalent to the pragma,
#pragma bfield_reduce_type on | off | reset
The following example demonstrates how this option works.
typedef struct { long a: 4; long b: 4; } SomeStruct;
Assuming we initialize an instance of SomeStruct as below:
SomeStruct s = {2,7};
we get the following memory layouts for s:
-bfield_reduce_type (default): 72 ( [b][a]] )
-nobfield_reduce_type : 72 00 00 ( [b][a]] [0|0|0|0|0|0|0|0] [0|0|0|0|0|0|0|0] )
For more information, refer to the pragma bfield_reduce_type.