Most other PIC compilers consider the type int as a 16 bit integer. I prefer to consider it as 8 bit, because, as stated by the C language definition the int type represents the natural integer for the target processor. This definition guarantee to gain optimal performances from the processor when an int is used. PIC-18 devices are based on 8 bit data registers, so I suppose that an int should be coded on 8 bits for this kind of processor.
People who are not happy with 8 bit ints, or unsigned long long declarations, can use the standard ANSI types declared (with a typedef instruction) in the <types.h> header file as following:
cpik type | ANSI type |
char |
char_t |
unsigned char |
uchar_t |
int |
int8_t |
unsigned int |
uint8_t |
long |
int16_t |
unsigned long |
uint16_t |
unsigned long |
size_t |
long long |
int32_t |
unsigned long long |
uint32_t |
Alain Gibaud 2015-07-09