-BfaTSR: Bitfield Type Size Reduction

Group

CODE GENERATION

Scope

Function

Syntax
-BfaTSR[ON|OFF] 
Arguments

ON: Bit Field Type Size Reduction enabled

OFF: Bit Field Type-Size Reduction disabled

Default
HC08: -BfaTSRON 
Defines
 __BITFIELD_TYPE_SIZE_REDUCTION__ 
 __BITFIELD_NO_TYPE_SIZE_REDUCTION__ 
Pragmas

None

Description

This option is available whether or not the compiler uses type-size reduction for bitfields. Type-size reduction means that the compiler reduces the type of an int bitfield to a char bitfield if the int bitfield fits into a character. Type-size reduction 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