Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
C Language Features
 2012 Microchip Technology Inc.
DS52053B-page 143
5.4
SUPPORTED DATA TYPES AND VARIABLES
5.4.1
Identifiers
A C variable identifier (the following is also true for function identifiers) is a sequence 
of letters and digits, where the underscore character “_” counts as a letter. Identifiers 
cannot start with a digit. Although they may start with an underscore, such identifiers 
are reserved for the compiler’s use and should not be defined by your programs. Such 
is not the case for assembly domain identifiers, which often begin with an underscore, 
see Section 5.12.3.1 “Equivalent Assembly Symbols”.
Identifiers are case sensitive, so main is different to Main.
Not every character is significant in an identifier. The maximum number of significant 
characters can be set using an option, see Section 4.8.9 “-N: Identifier Length”. If 
two identifiers differ only after the maximum number of significant characters, then the 
compiler will consider them to be the same symbol.
5.4.2
Integer Data Types
The MPLAB XC8 compiler supports integer data types with 1, 2, 3 and 4 byte sizes as 
well as a single bit type. Table 5-1 shows the data types and their corresponding size 
and arithmetic type. The default type for each type is underlined.
The bit and short long types are non-standard types available in this implementa-
tion. The long long types are C99 Standard types.
All integer values are represented in little endian format with the Least Significant bit 
(LSb) at the lower address.
If no signedness is specified in the type, then the type will be signed except for the 
char
 types which are always unsigned. The bit type is always unsigned and the 
concept of a signed bit is meaningless.
TABLE 5-1:
INTEGER DATA TYPES
Type
 Size (bits)
 Arithmetic Type
bit
1
Unsigned integer
signed char
8
Signed integer
unsigned char
8
Unsigned integer
signed short
16
Signed integer
unsigned short
16
Unsigned integer
signed int
16
Signed integer
unsigned int
16
Unsigned integer
signed short long
24
Signed integer
unsigned short long
24
Unsigned integer
signed long
32
Signed integer
unsigned long
32
Unsigned integer
signed long long
32
Signed integer
unsigned long long
32
Unsigned integer