4.1.3 Implementation Defined Items

The following shows compiler specifications for the implementation-defined items which are not prescribed in the language specifications.

(1)

Translation

Table 4.1

Translation Specifications

No.

Item

Compiler Specifications

1

Diagnostic messages

When a syntax rule violation or a restriction violation occurs on a translation unit, the compiler outputs an error message containing the source file name and (when it can be determined) the line number where the violation is detected.

(2)

Environment

Table 4.2

Environment Specifications

No.

Item

Compiler Specifications

1

Purpose of actual argument for the main function

Not stipulated

2

Structure of interactive I/O devices

Not stipulated

(3)

Identifiers

Table 4.3

Identifier Specifications

No.

Item

Compiler Specifications

1

Number of valid letters in non externally-linked identifiers (internal names)

Up to 8189 characters are handled as significant.

2

Number of valid letters in externally-linked identifiers (external names)

Up to 8191 characters are handled as significant.

3

Distinction of uppercase and lowercase letters in externally-linked identifiers (external names)

Uppercase and lowercase alphabetic letters are distinguished.

(4)

Characters

Table 4.4

Character Specifications

No.

Item

Compiler Specifications

1

Elements of source character sets and execution character set

The source program character set and execution character set are both ASCII codes. The supported multi-byte characters are EUC, SJIS, UTF-8, big5, and gb2312. Japanese and Chinese characters are supported in comments and character strings.

2

Shift states used in coding multibyte characters

The compiler does not have representation formats that depend on the shift state.

3

Number of bits for a character in character sets in program execution

8 bits for a character and 16 bits for a multi-byte character.

4

Relationship between source program character sets in character constants and strings and characters in execution character set

The elements of the source code character set and execution character set are the same.

5

Values of integer character constants that include characters or escape sequences which are not stipulated in the language specifications

The value of an octal or hexadecimal escape sequence is the value that is represented by the octal or hexadecimal number written in the escape sequence.

6

Values of character constants that include two or more characters, and wide character constants that include two or more multibyte characters

For an integer character constant that contains four bytes of characters (four characters in ASCII codes), the value of all four bytes is valid. A character constant that contains five or more bytes will lead to an error.

7

Specifications of locale used for converting multibyte characters to wide characters

locale is not supported.

8

char type value

A plain char type without type specifier (signed or unsigned) is handled as an unsigned integer (unsigned char). Note that this handling can be changed through option settings.

(5)

Integers

Table 4.5

Integer Specifications

No.

Item

Compiler Specifications

1

Representation and values of integer types

See Table 4.6.

2

Values when integers are converted to shorter signed integer types or unsigned integers are converted to signed integer types of the same size (when converted values cannot be represented by the target type)

When converting to a shorter type, the integer is masked with the number of bits of the shorter type (high-order bits are discarded) and the resultant bit sequence is used. When an unsigned integer is converted to a signed integer having the same length, the bit sequence is copied without change.

3

Result of bit-wise operations on signed integers

For the shift operators, refer to no. 5 in this table. For the other operators, the integers are calculated as unsigned values (the value of each bit is handled as is).

4

Remainder sign in integer division

If the operand is negative, the result of the "%" operator takes the sign of the first operand (dividend) in the expression.

5

Result of right shift of signed scalar types with a negative value

If E1 of "E1 >> E2" is of a signed type and takes a negative value, an arithmetic shift is executed.

 

Table 4.6

Range of Integer Types and Values

No.

Type

Value Range

Data Size

1

char *1

0 to 255

1 byte

2

signed char

−128 to 127

1 byte

3

unsigned char

0 to 255

1 byte

4

short, signed short

−32768 to 32767

2 bytes

5

unsigned short

0 to 65535

2 bytes

6

int*2, signed int*2

−2147483648 to 2147483647

4 bytes

7

unsigned int*2

0 to 4294967295

4 bytes

8

long, signed long

−2147483648 to 2147483647

4 bytes

9

unsigned long

0 to 4294967295

4 bytes

10

long long, signed long long

–9223372036854775808 to 9223372036854775807

8 bytes

11

unsigned long long

0 to 18446744073709551615

8 bytes

Notes 1.

When the -signed_char option is specified, the char type has the same value range as signed char type.

Notes 2.

When the int_to_short option is specified, the int type is handled as the short type, the signed int type as the signed short type, and the unsigned int type as the unsigned short type.

(6)

Floating-Point Numbers

Table 4.7

Floating-Point Number Specifications

No.

Item

Compiler Specifications

1

Representation and values of floating-point types

There are three types of floating-point numbers: float, double, and long double types. See section "(5) Floating-Point Number Specifications" in "4.1.4 Internal Data Representation and Areas" for the internal representation of floating-point types and specifications for their conversion and operation. Table 4.8 shows the limits of floating-point type values that can be expressed.

2

Method of truncation when integers are converted into floating-point numbers that cannot accurately represent the actual value

Rounding is to the nearest value if any of the following conditions is satisfied:

-

-nofpu is specified.

-

-cpu=rx200 is specified.

-

Either -cpu=rx600 or -isa=rxv1 is specified, and the integer to be converted is unsigned.

Otherwise, rounding is in accord with the setting of the RM[0:1] bits in the FPSW.

3

Methods of truncation or rounding when floating-point numbers are converted into shorter floating-point types

Rounding is to the nearest value.

 

Table 4.8

Limits of Floating-Point Type Values

No.

Item

Limits

Decimal Notation*1

Internal Representation (Hexadecimal)

1

Maximum value of float type

3.4028235677973364e+38f

(3.4028234663852886e+38f)

7f7fffff

2

Minimum positive value of float type

7.0064923216240862e−46f

(1.4012984643248171e−45f)

00000001

3

Maximum values of double type and long double type*2

1.7976931348623158e+308

(1.7976931348623157e+308)

7fefffffffffffff

4

Minimum positive values of double type and long double type *2

4.9406564584124655e−324

(4.9406564584124654e−324)

0000000000000001

Notes 1.

The limits for decimal notation are the maximum value smaller than infinity and the minimum value greater than 0. Values in parentheses are theoretical values.

Notes 2.

These values are the limits when dbl_size=8 is specified. When dbl_size=4 is specified, the double type and long double type have the same value as the float type.

(7)

Arrays and Pointers

Table 4.9

Array and Pointer Specifications

No.

Item

Compiler Specifications

1

Integer type (size_t) required to hold maximum array size

unsigned long type.

2

Conversion from pointer type to integer type (pointer type size >= integer type size)

Value of least significant byte of pointer type

3

Conversion from pointer type to integer type (pointer type size < integer type size)

Zero extension

4

Conversion from integer type to pointer type (integer type size >= pointer type size)

Value of least significant byte of integer type

5

Conversion from integer type to pointer type (integer type size < pointer type size)

Sign extension

6

Integer type (ptrdiff_t) required to hold difference between pointers to members in the same array

int type.

(8)

Registers

Table 4.10

Register Specifications

No.

Item

Compiler Specifications

1

Types of variables that can be assigned to registers

Optimizes for the fastest possible access regardless of whether there is a storage-class specifier "register" declaration.

(9)

Class, Structure, Union, and Enumeration Types, and Bit Fields

Table 4.11

Class, Structure, Union, and Enumeration Types, and Bit Field Specifications

No.

Item

Compiler Specifications

1

Referencing members in union type accessed by members of different types

When a member of a union object is accessed using a member of a different type, the internal representation of the data will be of the type of the access.

2

Boundary alignment of class and structure members

The maximum alignment value of the class and structure members is used as the boundary alignment value. For details on assignment, see section "(2) Compound Type (C), Class Type (C++)" in "4.1.4 Internal Data Representation and Areas".

3

Sign of bit fields of simple int type

A bit field declared without indication of signed or unsigned is handled as an unsigned bit field.

4

Order of bit fields within int type size

The bit field that is declared first is assigned from the least significant bit in the area of the type that is specified in the bit field declaration. Note that this order can be changed through option settings.*1

5

Method of assignment when the size of a bit field assigned after a bit field is assigned within an int type size exceeds the remaining size in the int type

Assigned to next int type area.*1

6

Type specifiers allowed for bit fields

signed char, unsigned char, bool, _Bool, short, unsigned short, int, unsigned int, long, unsigned long, enum, long long, unsigned long long, wchar_t

7

Integer type representing value of enumeration type

The internal representation of an enumeration type is the same as that of the signed long type. The leftmost bit of the area is the sign bit.

When the auto_enum option is specified, the smallest type that can hold the enumeration values is used.

Notes 1.

For details of assignment of bit fields, see section4.1.4 Internal Data Representation and Areas.

(10)

Type Qualifiers

Table 4.12

Type Qualifier Specifications

No.

Item

Compiler Specifications

1

Types of access to data qualified with volatile

Not stipulated

(11)

Declarations

Table 4.13

Declaration Specifications

No.

Item

Compiler Specifications

1

Number of declarations modifying basic types (arithmetic types, structure types, union types)

128 max.

The following shows examples of counting the number of types modifying basic types.

i. int a; Here, a has an int type (basic type) and the number of types modifying the basic type is 0.

ii. char *f(); Here, f has a function type returning a pointer type to a char type (basic type), and the number of types modifying the basic type is 2.

(12)

Statements

Table 4.14

Statement Specifications

No.

Item

Compiler Specifications

1

Number of case labels that can be declared in one switch statement

There is no limitation on the number.

(13)

Preprocessor

Table 4.15

Preprocessor Specifications

No.

Item

Compiler Specifications

1

Relationship between single-character character constants in constant expressions in a conditional inclusion, and execution character set

Preprocessor statement character constants are the same as the execution character set. Single-character character constants do not take negative values.

2

Method of reading include files

When a file name is specified with an absolute path, the directory indicated by the path is first searched for the header file. In other cases, the directory where the source file is stored is searched first. Then, the specified directory (-include option) and the standard include file directory (specified with the INC_RX environment variable) are searched in that order.

3

Support for include files enclosed in double-quotes

The include file is read from the folder holding the file that contains the #include directive. If the file is not found, the file is searched for as described in no. 2 above.

4

Space characters in strings after a macro is expanded

The preprocessing token enclosed between < and > or double-quotes (") is handled as a header name without change. When the code generated after macro expansion includes <character-string> or "character-string", the character string is handled as a header name.

5

Operation of #pragma statements

See 4.2.3 #pragma Directive

6

__DATE__ and __TIME__ values

Values are specified based on the host computer's timer at the start of compiling.

(14)

Library functions

Table 4.16

Library function Specifications

No.

Item

Compiler Specifications

1

Value of macro NULL

Value 0.

2

The diagnostic printed by and the termination behavior of the assert function

The message depends on the lang option setting at compilation.

(1) When -lang=c99 is not specified (C (C89), C++, or EC++ language):

ASSERTION FAILED:expressionFILE<file name>,LINE<line number>

(2) When -lang=c99 is specified (C (C99) language):

ASSERTION FAILED:expressionFILE<file name>,LINE<line number>FUNCNAME<function name>

The operation when the assert function execution is completed is not specified; it depends on the specifications of the low-level interface routine.

3

The character set inspected by the isalnum, isalpha, iscntrl, islower, isprint, and isupper functions

Character set represented by the unsigned char type (0 to 255) and EOF (-1). Table 7.7 shows the character set that results in a true return value.

4

Value returned by a mathematical function if an input argument is out of the range

A not-a-number is returned. For details on the format of not-a-numbers, refer to section "(5) Floating-Point Number Specifications" in "4.1.4 Internal Data Representation and Areas".

5

Whether errno is set to the value of macro ERANGE if an underflow error occurs in a mathematical function

For the functions that set errno to the value of ERANGE, see "10.5.6 Standard Library Error Messages". The other functions do not set errno to ERANGE.

6

Whether a range error occurs if the second argument in the fmod function is 0

A range error occurs.

For details of the return value from fmod, see "fmod/fmodf/fmodl" in "7.4.7 <math.h>".

7

The set of signals for the signal function

The signal function is not supported.

8

The semantics for each signal recognized by the signal function

The signal function is not supported.

9

The default handling and the handling at program startup for each signal recognized by the signal function

The signal function is not supported.

10

If the equivalent of signal(sig, SIG_DFL); is not executed prior to the call of a signal handler, the blocking of the signal that is performed

The signal function is not supported.

11

Whether the default handling is reset if the SIGILL signal is received by a handler specified to the signal function

The signal function is not supported.

12

Whether the last line of the input text requires a new-line character indicating the end

Not specified. Depends on the low-level interface routine specifications.

13

Whether the space characters written immediately before the new-line character are read

Not specified. Depends on the low-level interface routine specifications.

14

Number of null characters added to data written in the binary file

Not specified. Depends on the low-level interface routine specifications.

15

Initial value of file position indicator in the append mode

Not specified. Depends on the low-level interface routine specifications.

16

Whether file data is lost after output to a text file

Not specified. Depends on the low-level interface routine specifications.

17

File buffering specifications

Not specified. Depends on the low-level interface routine specifications.

18

Whether a file with file length 0 exists

Not specified. Depends on the low-level interface routine specifications.

19

File name configuration rule

Not specified. Depends on the low-level interface routine specifications.

20

Whether the same file is opened simultaneously

Not specified. Depends on the low-level interface routine specifications.

21

The effect of the remove function on an open file

The remove function is not supported.

22

The effect if a file with the new name exists prior to a call to the rename function

The rename function is not supported.

23

Output data representation of the %p format conversion in the fprintf function

Hexadecimal representation.

24

Input data representation of the %p format conversion in the fscanf function

Hexadecimal representation.

25

The meaning of conversion specifier '-' in the fscanf function

If '-' is not the first or last character or '-' does not follow '^', the range from the previous character to the following character is indicated.

26

Value of errno specified by the fgetpos or ftell function

The fgetpos function is not supported.

The errno value for the ftell function is not specified. It depends on the low-level interface routine specifications.

27

Output format of messages generated by the perror function

See (a) below for the output message format.

28

calloc, malloc, or realloc function operation when the size is 0.

NULL is returned.

29

The behavior of the abort function with regard to open and temporary files

The behavior is not specified; it depends on the specifications of the low-level interface routine.

30

The status returned by the exit function if the value of the argument is other than zero, EXIT_SUCCESS, or EXIT_FAILURE

The exit function is not supported.

31

The set of environment names and the method for altering the environment list used by the getenv function

The getenv function is not supported.

32

The contents and mode of execution of the string by the system function

The system function is not supported.

33

The contents of the error message strings returned by the strerror function

According to the implementation-defined relationship, the error number errnum is converted to a character string. errnum has the value copied from the global variable errno in most cases.

For details, see "10.5.6 Standard Library Error Messages".

34

The local time zone and Daylight Saving Time

time.h is not supported.

35

The era for the clock function

The clock function is not supported.