-BfaTSR: Bitfield Type-Size Reduction

Group

CODE GENERATION

Scope

Function

Syntax
-BfaTSR[ON|OFF]

Arguments

ON: Bitfield Type Size Reduction enabled

OFF: Bitfield Type-Size Reduction disabled

Default
-BfaTSRON

Defines

__BITFIELD_TYPE_SIZE_REDUCTION__

__BITFIELD_NO_TYPE_SIZE_REDUCTION__

Pragmas

None

Description

This option is configurable whether or not the compiler uses type-size reduction for bitfields. Type-size reduction means that the compiler can reduce the type of an int bitfield to a char bitfield if it fits into a character. This allows the compiler to allocate memory only for one byte instead of for an integer.

Examples

The following listings demonstrate the effects of -BfaTSRoff and -BfaTSRon, respectively.

Listing: -BfaTSRoff


struct{
  long b1:4;

  long b2:4;

} myBitfield;

31                       7  3  0

--------------------------------

|########################|b2|b1|  -BfaTSRoff

--------------------------------
Listing: -BfaTSRon


7   3    0
----------

|b2 | b1 |  -BfaTSRon

----------
Example
-BfaTSRon

See also

Bitfield Type Reduction