6.9.1 Implementation-Defined Limit Macros
Include
<limits.h>
Remarks
The macros in the following table relate to the sizes of the integer types and expand to
constant expressions that can be used in the controlling expression with
#if
preprocessor directives.
The baseline and non-enhanced mid-range PIC devices supported by MPLAB XC8 do not
implement 64-bit integer types, and all the long long int
integer types
are 32 bits wide for these devices. For all other devices, regardless of compiler
utilized, the long long int
types are 64-bit wide.
Macro Name | Description | Value |
---|---|---|
CHAR_BIT | Number of bits to represent type
char | 8 |
CHAR_MAX | Maximum value of a
char |
When When |
CHAR_MIN | Minimum value of a
char |
When When |
UCHAR_MAX | Maximum value of an unsigned
char | 255 |
SCHAR_MAX | Maximum value of a signed
char | 127 |
SCHAR_MIN | Minimum value of a signed
char | -128 |
USHRT_MAX | Maximum value of an unsigned short
int | 65535 |
SHRT_MAX | Maximum value of a short
int | 32767 |
SHRT_MIN | Minimum value of a short
int | -32768 |
UINT_MAX | Maximum value of an unsigned
int |
MPLAB XC8: MPLAB XC-DSC (dsPIC33A devices): MPLAB XC16 and XC-DSC (other devices): MPLAB XC32: |
INT_MAX | Maximum value of a int |
MPLAB XC8: MPLAB XC-DSC (dsPIC33A devices): MPLAB XC16 and XC-DSC (other devices): MPLAB XC32: |
INT_MIN | Minimum value of a int |
MPLAB XC8: MPLAB XC-DSC (dsPIC33A devices): MPLAB XC16 and XC-DSC (other devices): MPLAB XC32: |
ULONG_MAX | Maximum value of a long unsigned
int | 4294967295 |
LONG_MAX | Maximum value of a long
int | 2147483647 |
LONG_MIN | Minimum value of a long
int | -2147483648 |
ULLONG_MAX | Maximum value of a long long unsigned
int |
Devices lacking 64 bit support (see Remarks):
All other devices: |
LLONG_MAX | Maximum value of a long long
int |
Devices lacking 64 bit support (see Remarks):
All other devices: |
LLONG_MIN | Minimum value of a long long
int |
Devices lacking 64 bit support (see Remarks):
All other devices: |
MB_LEN_MAX | Maximum number of bytes in a multibyte character |
MPLAB XC8: MPLAB XC16 and XC-DSC: MPLAB XC32: |