uchar_bool

Controls the size of the _Bool and bool data types.

Syntax
#pragma uchar_bool on | off | reset
  
Remarks

When on , the compiler translates the _Bool data type in C99 (ISO/IEC 9899-1999) source code and the bool data type in C++ source code to 8 bit values. When off , these data types are 32 bits. Use this pragma only before any declarations.

When this pragma is off (boolean values are 32-bits), use bitfields to ensure that a boolean value is 8 bits. Example of overriding uchar_bool in a structure in C++ shows an example.

Listing 1. Example of overriding uchar_bool in a structure in C++
#pragma uchar_bool off /* Boolean values are 32 bits */

typedef struct
{
  bool sockclean:8 /* This value will only occupy 8 bits. */
} sockrec;