3.12 Standard library functions

Among the standard library functions of the CA78K0R, va_starttop and calls of standard library functions for the near or far pointer whose function name is post-fixed with "_n" or "_f" are converted into standard library functions of the CC-RL. Normal standard library functions are not converted because the same functions are available.

 

-

Do not use the CcnvCA78K0R to convert the header file of the standard libraries for the CA78K0R and make the CC-RL handle the converted header file. Use the header file of the standard libraries for the CC-RL.

-

Since the function name is converted by replacing strings, if a macro name, variable name, tag name, etc. of the same name exists, they will also be replaced.

-

The CC-RL does not have a large model. When a C source program for a large model is converted, the type of parameters or return values of standard libraries may not match. Before performing conversion, manually modify the descriptions of the C source program to the standard library functions for the far pointer.

 

Table 3.6

Conversion of Standard Library Functions

Function Name of CA78K0R

After Conversion

Remarks

toup

_toupper

Not converted

Handled as a user function in the CC-RL.

Use the toupper function.

tolow

_tolower

Not converted

Handled as a user function in the CC-RL.

Use the tolower function.

va_starttop

va_start

 

sprintf_n

sprintf

Only functions for the far pointer exist in the CC-RL.

After conversion, the pointer type is converted from near to far in the parameter.

sprintf_f

sprintf

 

sscanf_n

sscanf

Only functions for the far pointer exist in the CC-RL.

After conversion, the pointer type is converted from near to far in the parameter.

sscanf_f

sscanf

 

printf_n

printf

Only functions for the far pointer exist in the CC-RL.

After conversion, the pointer type is converted from near to far in the parameter.

printf_f

printf

 

scanf_n

scanf

Only functions for the far pointer exist in the CC-RL.

After conversion, the pointer type is converted from near to far in the parameter.

scanf_f

scanf

 

vprintf_n

vprintf

Only functions for the far pointer exist in the CC-RL.

After conversion, the pointer type is converted from near to far in the parameter.

vprintf_f

vprintf

 

vsprintf_n

vsprintf

Only functions for the far pointer exist in the CC-RL.

After conversion, the pointer type is converted from near to far in the parameter.

vsprintf_f

vsprintf

 

gets_n

gets

 

gets_f

_COM_gets_f

 

puts_n

puts

 

puts_f

_COM_puts_f

 

_putc

Not converted

Handled as a user function in the CC-RL.

atof_n

atof

 

atof_f

_COM_atof_f

 

atoi_n

atoi

 

atoi_f

_COM_atoi_f

 

atol_n

atol

 

atol_f

_COM_atol_f

 

strtod_n

strtod

 

strtod_f

_COM_strtod_ff

 

strtol_n

strtol

 

strtol_f

_COM_strtol_ff

 

strtoul_n

strtoul

 

strtoul_f

_COM_strtoul_ff

 

atexit

Not converted

atexit is not supported in the CC-RL.

Handled as a user function in the CC-RL.

brk

Not converted

Handled as a user function in the CC-RL.

sbrk

Not converted

Handled as a user function in the CC-RL.

itoa

Not converted

Handled as a user function in the CC-RL.

ltoa

Not converted

Handled as a user function in the CC-RL.

ultoa

Not converted

Handled as a user function in the CC-RL.

bsearch_n

bsearch

 

bsearch_f

_COM_bsearch_f

 

qsort_n

qsort

 

qsort_f

_COM_qsort_f

 

strbrk

Not converted

Handled as a user function in the CC-RL.

strsbrk

Not converted

Handled as a user function in the CC-RL.

stritoa

Not converted

Handled as a user function in the CC-RL.

strltoa

Not converted

Handled as a user function in the CC-RL.

strultoa

Not converted

Handled as a user function in the CC-RL.

memcpy_n

memcpy

 

memcpy_f

_COM_memcpy_ff

 

memmove_n

memmove

 

memmove_f

_COM_memmove_ff

 

strcpy_n

strcpy

 

strcpy_f

_COM_strcpy_ff

 

strncpy_n

strncpy

 

strncpy_f

_COM_strncpy_ff

 

strcat_n

strcat

 

strcat_f

_COM_strcat_ff

 

strncat_n

strncat

 

strncat_f

_COM_strncat_ff

 

memcmp_n

memcmp

 

memcmp_f

_COM_memcmp_ff

 

strcmp_n

strcmp

 

strcmp_f

_COM_strcmp_ff

 

strncmp_n

strncmp

 

strncmp_f

_COM_strncmp_ff

 

memchr_n

memchr

 

memchr_f

_COM_memchr_f

 

strchr_n

strchr

 

strchr_f

_COM_strchr_f

 

strcspn_n

strcspn

 

strcspn_f

_COM_strcspn_ff

 

strpbrk_n

strpbrk

 

strpbrk_f

_COM_strpbrk_ff

 

strrchr_n

strrchr

 

strrchr_f

_COM_strrchr_f

 

strspn_n

strspn

 

strspn_f

_COM_strspn_ff

 

strstr_n

strstr

 

strstr_f

_COM_strstr_ff

 

strtok_n

strtok

Only functions for the far pointer exist in the CC-RL.

After conversion, the pointer type is converted from near to far in the parameter.

strtok_f

strtok

 

memset_n

memset

 

memset_f

_COM_memset_f

 

strerror

Not converted

The type of the return value is the far pointer in the CC-RL.

Change the type at the code where the return value is used.

strlen_n

strlen

 

strlen_f

_COM_strlen_f

 

strcoll

strcoll_n

strcoll_f

Not converted

strcoll is not supported in the CC-RL.

Handled as a user function in the CC-RL.

strxfrm

strxfrm_n

strxfrm_f

Not converted

strxfrm is not supported in the CC-RL.

Handled as a user function in the CC-RL.

matherr

Not converted

Handled as a user function in the CC-RL.

__assertfail

Not converted

Handled as a user function in the CC-RL.

The assert macro can be used in the CC-RL without any change.