This section explains items dependent on processing system in the ANSI standards.
The byte order in a word (4 bytes) is "from least significant to most significant byte" Signed integers are expressed by 2's complements. The sign is added to the most significant bit (0 for positive or 0, and 1 for negative).
The ANSI standards specify eight translation stages (known as "phases") of priorities among syntax rules for translation. The arrangement of "non-empty white space characters excluding line feed characters" which is defined as processing system dependent in phase 3 "Decomposition of source file into preprocessing tokens and white space characters" is maintained as it is without being replaced by single white space character.
When syntax rule violation or restriction violation occurs on a translation unit, the compiler outputs as error message containing source file name and (when it can be determined) the number of line containing the error. These error messages are classified: "Warning", "Abort error", "Fatal error" and "other" messages. For output formats of messages, see the "10. MESSAGE".
The name and type of a function that is called on starting program processing are not stipulted.
Therefore, it is dependent on the user-own coding and target system.
The configuration of the interactive unit is not stipulated.
Therefore, it is dependent on the user-own coding and target system.
The values of elements of the execution environment character set are ASCII codes.
Supported multi-byte characters are ECU, SJIS, UTF-8, big5 and gb2312.
Japanese and Chinese description in comments and character strings is supported.
The values of expanded notation are stipulated as follows.
There are no limits on translation. The maximum translatable value depends on the memory of the host machine on which the program is running.
The limits.h file specifies the limit values of the values that can be expressed as general integer types (char type, signed/unsigned integer type, and enumerate type).
Because multi-byte characters are not supported, MB_LEN_MAX does not have a corresponding limit. Consequently, it is only defined with MB_LEN_MAX as 1.
The limit values defined by the limits.h file are as follows.
The limit values related to characteristics of the floating-point type are defined in float.h file.
The limit values defined by the float.h file are as follows.
All identifiers are considered to have meaning. There are no restrictions on identifier length.
Uppercase and lowercase characters are distinguished.
If a value larger than a char is stored in a char type, then the value is converted to type char.
A char type with no type specifier (signed, unsigned) specified is treated as a signed integer as the default assumption.
The floating-point constants conform to IEEE754Note.
IEEE: Institute of Electrical and Electronics Engineers |
Both the character set of the source program and the character set in the execution environment are basically ASCII codes, and correspond to members having the same value. |
The last character of the value of an integer character constant including two or more characters is valid. |
A character that cannot be expressed by the basic execution environment character set or escape sequence is expressed as follows. |
An octal or hexadecimal escape sequence takes the value indicated by the octal or hexadecimal notation |
Values of \a, \b, \f, \n, \r, \t, \v are same as the values explained in "(8) Significance of character display". |
A character string can be described in Japanese and Chinese.
The default character code is Shift JIS.
A character code in input source file can be selected by using the -Xcharacter_set option of the CC-RH.
The method to reflect the string in the two formats (< > and " ") of a header file name on the header file or an external source file name is stipulated in "(33) Loading header file".
A comment can be described in Japanese and Chinese. The character code is the same as the character string in "(15) Character string".
If the value of a general integer type is converted into a signed integer of a smaller size, the higher bits are truncated and a bit string image is copied.
If an unsigned integer is converted into the corresponding signed integer, the internal representation is not changed.
If the value of a general integer type is converted into the value of a floating-point type, and if the value to be converted is within a range that can be expressed but not accurately, the result is rounded to the closest expressible value.
When casting a double to a float, or a long double to a double or a float, if the typecast value cannot be represented accurately in the available value range, then the result will be rounded to the nearest value that can be represented.
The characteristics of the shift operator conform to the stipulation in "(27) Shift operator in bit units".
The other operators in bit units for signed type are calculated as unsigned values (as in the bit image).
If the value of a union member is stored in a different member, the value will be stored in accordance with the alignment condition. As a result, access to members of the union will be of the subsequently accessed type.
The value resulting from the "sizeof" operator conforms to the stipulation related to the bytes in an object in "(1) Data types and sizes".
For the number of bytes in a structure and union, it is byte including padding area.
When a pointer is converted into a general integer type, the required size of the variable is the same as the size of the unsigned long type. The bit string is saved as is as the conversion result.
Also, although it is possible to typecast an arbitrary integer to a pointer, after the integer is typecast to a pointer, the integer's bit pattern is retained unchanged.
The result of the division operator ("/") when the operands are negative and do not divide perfectly with integer division, is as follows: If either the divisor or the dividend is negative, the result is the smallest integer greater than the algebraic quotient.
If both the divisor and the dividend are negative, the result is the largest integer less than the algebraic quotient.
If the operand is negative, the result of the "%" operator takes the sign of the first operand in the expression.
If two pointers indicating the elements of the same array are subtracted, the type of the result is unsigned long type.
If E1 of "E1 >> E2" is of signed type and takes a negative value, an arithmetic shift is executed.
Optimize for the fastest possible access, regardless of whether there is a storage-class area specifier "register" declaration.
A simple int type bit field without signed or unsigned appended is treated as a signed field, and the most significant bit is treated as the sign bit. |
To retain a bit field, a storage area unit to which any address with sufficient size can be assigned can be allocated. If there is insufficient area, however, the bit field that does not match is packed into to the next unit according to the alignment condition of the type of the field. |
If packing is used, however, the boundaries of all members will be the byte boundary.
The type of an enumeration specifier is signed int.
However, when the -Xenum_type=auto option is specified, each enumerated type is treated as the smallest integer type capable of expressing all the enumerators in that type.
The configuration of access to data having a type qualified to be "volatile" is dependent upon the address (I/O port, etc.) to which the data is mapped. If packing is used, however, the boundaries of all members will be the byte boundary.
The value for the constant specified for condition embedding and the value of the character constant appearing in the other expressions are equal. |
A preprocessing directive in the form of "#include <character string>" searches for a header file from the folder specified by the -I option if "character string" does not begin with "\"Note, and then searches standard include file folder (..\inc folder with a relative path from the bin folder where the ccrh is placed).
If a header file uniformly identified is searched with a character string specified between delimiters "<" and ">", the whole contents of the header file are replaced.
The search order is as follows.
A preprocessing directive in the form of "#include "character string"" searches for a header file from the folder where the source file exists, then searches specified folder (-I option) and then searches standard include file folder (..\inc folder with a relative path from the bin folder where the ccrh is placed).
If a header file uniformly identified is searched with a character string specified between delimiters " " " and " " ", the whole contents of the header file are replaced.
The search order is as follows.
The format of "#include preprocessing character phrase string" is treated as the preprocessing character phrase of single header file only if the preprocessing character phrase string is a macro that is replaced to the form of <character string> or "character string".
Between a string delimited (finally) and a header file name, the length of the alphabetic characters in the strings is identified,
The folder that searches a file conforms to the above stipulation.
The CC-RH can specify the following #pragma directives.
Allocates variables to an arbitrary section.
For details about the allocation method, see "4.2.4.1 Allocation of data and program to section".
Assembler directives can be described in a C source program.
For the details of description, see "4.2.4.2 Describing assembler instruction".
#pragma inline [(]function-name[, function-name ...][)] #pragma noinline [(]function-name[, function-name ...][)] |
A function that is expanded inline can be specified.
For the details of expansion specification, see "4.2.4.3 Inline expansion".
Interrupt/Exception handlers are described in C language.
For the details of description, see "(3) Describing interrupt/exception handler".
Interrupts are disabled for the entire function.
For details of description, see "(2) Disabling interrupts in entire function".
Specifies the packing of a structure type. The packing value, which is an alignment value of the member, is specified as the numeric value. A value of 1, 2, 4 can be specified. When the numeric value is not specified, it is by default alignment.
For details of description, see "4.2.4.8 Structure type packing".
This specifies a change to the order of the bit field.
For details of description, see "4.2.4.9 Bit field assignment".
A function to which a core number is to be assigned can be specified.
For details of description, see "4.2.4.10 Core number specification (for a multi-core device)".
This specifies the alignment value for branch destination addresses.
For details on specifying the alignment value for branch destination addresses, see "4.2.4.11 Specifying alignment value for branch destination addresses".
#pragma stack_protector [(]function-name[(num=value)][)] #pragma no_stack_protector [(]function-name[)] |
This specifies a function for generating a code for detection of stack smashing.
For details on how to write the code, see "4.2.4.12 Detection of stack smashing [Professional Edition only]".
All the following macro names are supported.
For the processing to be performed when the -Xansi option is specified, see "4.1.5 Option to process in strict accordance with ANSI standard". |