-convert_cc


This option supports transition of programs written for other compilers.

[Specification format]

-convert_cc={ca78k0r|nc30|iar}

 

-

Interpretation when omitted

The function for supporting transition of programs written for other compilers is disabled.

[Detailed description]

-

This option converts expanded functions of another compiler into expanded functions of the CC-RL. Operations come into compliance with the CC-RL specifications.

-

The same operations as the compiler before transition are not guaranteed for unspecified, undefined, and implementation-defined items in the ANSI C language.

-

A compile error will occur when this option is specified for more than once.

-

Correct operation is not guaranteed when linking objects with different compiler as a parameter of this option.

-

The parameters that can be specified are shown below.
A compile error will occur if any other parameter is specified.

Parameter

Description

ca78k0r

Enables the function for supporting transition of CA78K0R expanded language specifications.

nc30

Enables the function for supporting transition of NC30 expanded language specifications.

iar

Enables the function for supporting transition of ICCRL78 (IAR compiler) expanded language specifications.

 

Operations when -convert_cc=ca78k0r is specified are shown below.

-

The __CNV_CA78K0R__ macro is enabled.

-

A keyword following #pragma is recognized when it consists of only uppercase characters or only lowercase characters.
A keyword consisting of both uppercase and lowercase characters is handled as an unknown keyword.

-

The expanded language specifications are handled as follows:

Table 2.3

Operation When Transition Support Option is Specified (-convert_cc=ca78k0r)

Functions of ca78k0r

Functions in CC-RL

Operation When the Option is Specified

__callt, callt

__callt

When the -ansi option is not specified, the callt keyword is replaced with __callt.

__callf, callf

None

Not supported.

A syntax error will occur.

__sreg, sreg

__saddr

The __sreg keyword is replaced with __saddr.

When the -ansi option is not specified, the sreg keyword is replaced with __saddr.

__leaf, norec, noauto

None

Not supported.

A syntax error will occur.

__boolean, boolean, bit

None

When the -ansi option is specified, the __boolean keyword is replaced with char.

When the -ansi option is not specified, the __boolean, boolean, or bit keyword is replaced with _Bool.

__interrupt

__interrupt_brk

#pragma interrupt

#pragma interrupt_brk

When the #pragma directive for the function qualified with the keyword is in the same file, the keyword is deleted.

Otherwise, the keyword is replaced with the #pragma directive.

__asm

#asm ~ #endasm

#pragma inline_asm

Not supported.

__asm is handled as a normal function call.

#asm and #endasm will generate a syntax error.

__rtos_interrupt

#pragma rtos_interrupt

When the #pragma directive for the function qualified with the keyword is in the same file, the keyword is deleted.

Otherwise, the keyword is replaced with the #pragma directive.

__pascal

None

Not supported.

A syntax error will occur.

__flash

None

Not supported.

A syntax error will occur.

__flashf

None

Not supported.

A syntax error will occur.

__directmap

#pragma address

The keyword is deleted and #pragma address is newly created. When __sreg, sreg or __saddr is specified additionally, a compile error will occur. When multiple variables are specified in the same address, an error will occur.

__temp

None

Not supported.

A syntax error will occur.

__near, __far

__near, __far

The operation rules for the far pointer conform to the
CC-RL specifications.

The location for writing the __near or __far keyword in a function declaration or function pointer declaration conforms to the CC-RL specifications. When conforming to the CA78KOR specifications, a syntax error will occur.

For the operation rules for the far pointer, see "Pointer operation" in "Specifying memory allocation area (__near /__far)".

__mxcall

None

Not supported.

A syntax error will occur.

#pragma sfr

#include iodefine.h

The #pragma directive is ignored and a warning message is output.

Reference to SFR including bit access is converted into reference to a symbolic constant defined in iodefine.h.

Inclusion of iodefine.h must be specified manually.

#pragma vect

#pragma interrupt

#pragma interrupt

#pragma interrupt_brk

The specifications are replaced with the CC-RL specifications.

The vect keyword is replaced with interrupt.

When the interrupt request name is BRK_I, the interrupt or vect keyword is replaced with interrupt_brk.

If the directive includes stack switching, the specification is deleted and a warning message is output.

The interrupt request name is converted into the address defined in iodefine.h. Inclusion of iodefine.h must be specified manually.

If the C source file has only a #pragma directive and no function declaration or function definition, no vector table is generated and no error will occur at linkage.

Only a single interrupt request name can be set in an interrupt handler.

#pragma rtos_interrupt

#pragma rtos_interrupt

The specifications are replaced with the CC-RL specifications.

The interrupt request name is converted into the address defined in iodefine.h. Inclusion of iodefine.h must be specified manually.

If the C source file has only a #pragma directive and no function declaration or function definition, no vector table is generated and no error will occur at linkage.

#pragma rtos_task

#pragma rtos_task

The specifications are replaced with the CC-RL specifications.

#pragma di

#pragma ei

__DI

__EI

Call to function DI or EI is replaced with call to __DI or __EI, respectively.

#pragma halt

#pragma stop

#pragma brk

#pragma nop

__halt

__stop

__brk

__nop

Call to function HALT, STOP, BRK, or NOP is replaced with call to __halt, __stop, __brk, or __nop, respectively.

#pragma section

#pragma section

The compiler output section name is replaced with a section name conforming to the CC-RL specifications. If the directive includes an address specification, the specification is deleted and a warning message is output. If it cannot be replaced with a section name conforming to the CC-RL specifications, the #pragma directive is deleted and a warning message is output.

For the section names that can be written in the CC-RL, see "Changing compiler output section name (#pragma section)".

#pragma name

None

The #pragma directive is deleted and a warning message is output.

#pragma rot

__rolb, __rorb,

__rolw, __rorw

Call to function rolb, rorb, rolw, or rorw is replaced with call to __rolb, __rorb, __rolw, or __rorw, respectively.

#pragma mul

__mulu,

__mului, __mulsi

Call to function mulu, muluw, or mulsw is replaced with call to __mulu, __mului, or __mulsi, respectively.

#pragma div

__divui, __remui

Call to function divuw or moduw is replaced with call to __divui or __remui, respectively.

#pragma mac

__macui, __macsi

Call to function macuw or macsw is replaced with call to __macui or __macsi, respectively.

#pragma bcd

None

The #pragma directive is deleted and a warning message is output.

#pragma opc

None

The #pragma directive is deleted and a warning message is output.

#pragma ext_func

None

The #pragma directive is deleted and a warning message is output.

#pragma inline

None

If a line feed follows the #pragma directive, the #pragma directive is deleted and a warning message is output.

If a function name following the #pragma directive is in the same line, the #pragma directive is handled as #pragma inline (with different function) in the CC-RL specifications.

Binary constant

Binary constant

Handled as a binary constant without change.

__K0R__

__RL78__

The macro is enabled (decimal constant 1).

__K0R__SMALL__

__RL78_SMALL__

The macro is enabled (decimal constant 1) when small is specified with the -memory_model option or when S1 is specified with the -cpu option while the -memory_model option is not specified.

__K0R__MEDIUM__

__RL78_MEDIUM__

The macro is enabled (decimal constant 1) when medium is specified with the -memory_model option or when other than S1 is specified with the -cpu option while the
-memory_model option is not specified.

__K0R__LARGE__

None

Not supported.

Handled as a user-defined macro.

__CHAR_UNSIGNED__

__UCHAR

The macro is enabled (decimal constant 1) when the
-signed_char option is not specified.

__RL78_1__

__RL78_S2__

The macro is enabled (decimal constant 1) when S2 is specified with the -cpu option.

__RL78_2__

__RL78_S3__

The macro is enabled (decimal constant 1) when S3 is specified with the -cpu option.

__RL78_3__

__RL78_S1__

The macro is enabled (decimal constant 1) when S1 is specified with the -cpu option.

__CA78K0R__

None

The macro is enabled (decimal constant 1).

CPU macro

None

Not supported.

Handled as a user-defined macro.

Standard library function

va_starttop

va_start

In stdarg.h, va_starttop is replaced with va_start.

Standard library functions

toup, _toupper, tolow,

_tolower, _putc, calloc,

free, malloc, realloc,

atexit, brk, sbrk, itoa,

ltoa, ultoa, strbrk, strsbrk,

stritoa, strltoa, strultoa,

strcoll, strxfrm, matherr,

_assertfail

None

Not supported.

Handled as a normal function call.

standard library functions

Others

Standard library
functions

Conforms to the CC-RL specifications.

The location for writing the __near or __far keyword in a function declaration or function pointer declaration conforms to the CC-RL specifications. When conforming to the CA78KOR specifications, a syntax error will occur.

Standard library

Macro

Standard library

Macro

A macro with the same name as a macro defined in the header file of the CC-RL conforms to the CC-RL specifications.

Other macros are not supported. They are handled as user-defined macros.

 

Operations when -convert_cc=nc30 is specified are shown below.

-

The __CNV_NC30__ macro is enabled.

-

The expanded language specifications are handled as follows:

Table 2.4

Operation When Transition Support Option is Specified (-convert_cc=nc30)

Functions of nc30

Functions in CC-RL

Operation When the Option is Specified

wchar_t type

None

In stddef.h, the wchar_t type is declared as the unsigned short type using typedef.

Decimal constant with no suffix or with suffix l or L

int

long int

long long int

Decimal constant with no suffix or with suffix l or L

int

long int

long long int

Conforms to the CC-RL specifications.

Binary constant

Binary constant

Handled as a binary constant without change.

_ can be written between numeric values. If written in any other location, a syntax error will occur.

Wide character string

Wide character string

When combining a character string constant and a wide character string constant, conforms to the CC-RL specifications.

Default parameter
declaration of function

None

Not supported.

A syntax error will occur.

near, far

_near, _far

__near, __far

The keyword is replaced with __near or __far.

The operation rules for the far pointer conform to the
CC-RL specifications.

For the operation rules for the far pointer, see "Pointer operation" in "Specifying memory allocation area (__near /__far)".

asm, _asm

#pragma inline_asm

Not supported.

Handled as a normal function call.

inline, _inline

__inline

The keyword is replaced with __inline.

restrict

None

The keyword is deleted and a warning message is output.

_ext4mptr

None

The keyword is deleted and a warning message is output.

#pragma ROM

None

The #pragma directive is deleted and a warning message is output.

#pragma SECTION

#pragma section

The compiler output section name is replaced with a section name conforming to the CC-RL specifications.

If the invalid section type is used, the #pragma directive is deleted and a warning message is output.

If it cannot be replaced with a section name conforming to the CC-RL specifications, a compile error will occur.

#pragma STRUCT

None

The #pragma directive is deleted and a warning message is output.

#pragma EXT4MPTR

None

The #pragma directive is deleted and a warning message is output.

#pragma ADDRESS

#pragma address

Handled as #pragma address in the CC-RL specifications.

If the numeric notation of the address differs from that in the CC-RL specifications, the #pragma directive is deleted and a warning message is output.

#pragma BITADDRESS

None

The #pragma directive is deleted and a warning message is output.

#pragma INTCALL

None

The #pragma directive is deleted and a warning message is output.

#pragma INTERRUPT

#pragma interrupt

Handled as #pragma interrupt in the CC-RL specifications.

If written in a format that differs from that in the CC-RL specifications, the #pragma directive is deleted and a warning message is output.

#pragma PARAMETER

None

The #pragma directive is deleted and a warning message is output.

#pragma SPECIAL

#pragma callt

The function specified by the #pragma directive is handled as the callt function and a warning message is output.

The calling number is ignored.

#pragma ALMHANDLER

None

The #pragma directive is deleted and a warning message is output.

#pragma CYCHANDLER

None

The #pragma directive is deleted and a warning message is output.

#pragma INTHANDLER

#pragma HANDLER

None

The #pragma directive is deleted and a warning message is output.

#pragma TASK

None

The #pragma directive is deleted and a warning message is output.

#pragma __ASMMACRO

None

The #pragma directive is deleted and a warning message is output

#pragma ASM ~ ENDASM

None

The #pragma directive is deleted and a warning message is output.

#pragma JSRA

None

The #pragma directive is deleted and a warning message is output.

#pragma JSRW

None

The #pragma directive is deleted and a warning message is output.

#pragma PAGE

None

The #pragma directive is deleted and a warning message is output.

#pragma SBDATA

None

The #pragma directive is deleted and a warning message is output.

NC30

None

The macro is enabled (a space is defined).

M16C

None

The macro is enabled (a space is defined).

__R8C__

None

The macro is enabled (a space is defined).

__cplusplus

None

Handled as a user-defined macro.

Standard library functions

clearerr, fgetc, getc,

fgets, fread, fscanf, fputc,

putc, fputs, fwrite, fflush,

fprintf, vfprintf, ungetc,

ferror, feof, calloc, free,

malloc, realloc, mblen,

mbstowcs, mbtowc,

wcstombs, wctomb,

strcoll, stricmp, strnicmp,

strxfrm, bzero, bcopy,

memicmp, localeconv,

setlocale

None

Not supported.

Handled as a normal function call.

When an unsupported header file is included, a compile error will occur.

Standard library functions

Others

Standard library
functions

Conforms to the CC-RL specifications.

The location for writing the __near or __far keyword in a function declaration or function pointer declaration conforms to the CC-RL specifications.

Standard library

Macro

Standard library

Macro

A macro with the same name as a macro defined in the header file of the CC-RL conforms to the CC-RL specifications.

Other macros are not supported. They are handled as user-defined macros.

 

Operations when -convert_cc=iar is specified are shown below.

-

The __CNV_IAR__ macro is enabled.

-

The expanded language specifications are handled as follows:

Table 2.5

Operation When Transition Support Option is Specified (-convert_cc=iar)

Functions of iar

Functions in CC-RL

Operation When the Option is Specified

wchar_t type

None

In stddef.h, the wchar_t type is declared as the unsigned short type using typedef.

Anonymous union of file scope

None

Not supported.

A syntax error will occur.

__near, __far

__near, __far

The operation rules for the far pointer conform to the
CC-RL specifications.

For the operation rules for the far pointer, see "Pointer operation" in "Specifying memory allocation area (__near /__far)".

__near_func, __far_func

__near, __far

The keyword is replaced with __near or __far.

The operation rules for the far pointer conform to the
CC-RL specifications.

For the operation rules for the far pointer, see "Pointer operation" in "Specifying memory allocation area (__near /__far)".

__interrupt

#pragma interrupt

Replaced with "#pragma interrupt <function name>".

__monitor

None

The keyword is deleted and a warning message is output.

__no_bit_access

None

The keyword is deleted and a warning message is output.

__no_init

None

The keyword is deleted and a warning message is output.

__intrinsic

None

Not supported.

A syntax error will occur.

__noreturn

None

The keyword is deleted and a warning message is output.

__no_save

None

The keyword is deleted and a warning message is output.

__root

None

The keyword is deleted and a warning message is output.

__ro_placement

None

The keyword is deleted and a warning message is output.

__sfr

None

Not supported.

A syntax error will occur.

__saddr

__saddr

Handled as the __saddr keyword without change.

@ operator

#pragma address

Not supported.

A syntax error will occur.

__segment_begin

__sectop

Conversion is not performed and an error message is output.

__segment_end

__secend

Conversion is not performed and an error message is output.

__segment_size

None

An error message is output.

__ALIGNOF__

None

An error message is output.

static_assert

None

An error message is output.

__break

__brk

Replaced with __brk.

__disable_interrupt

__DI

Replaced with __DI.

__enable_interrupt

__EI

Replaced with __EI.

__get_interrupt_level

None

Handled as a normal function call.

__get_interrupt_state

None

Handled as a normal function call.

__mach

None

Handled as a normal function call.

__machu

None

Handled as a normal function call.

__no_operation

__nop

Replaced with __nop.

__set_interrupt_level

None

Handled as a normal function call.

__set_interrupt_state

None

Handled as a normal function call.

__stop

__stop

Handled as __stop without change.

#pragma vector

#pragma interrupt

Replaced with "#pragma interrupt <function name> (vect = address)".

The function name should be a function name in the function declaration subsequent to #pragma vector, and the __interrupt keyword is deleted.

If there is no subsequent __interrupt function, the #pragma declaration is deleted.

If multiple interrupt request names are specified for an interrupt handler, the first interrupt request name is set, and a warning message will be output for the second and subsequent interrupt request names and they will be ignored.

#pragma bank

#pragma interrupt

Replaced with "#pragma interrupt <function name> (bank={RB0 | RB1 | RB2 |RB3})".

The function name should be a function name in the function declaration subsequent to #pragma bank, and the __interrupt keyword is deleted.

The register bank after transition has "RB" added to the beginning of the number specified by #pragma bank.

If there is no subsequent __interrupt function, the #pragma declaration is deleted.

#pragma basic_template_matching

None

The #pragma directive is deleted and a warning message is output.

#pragma bitfields

None

The #pragma directive is deleted and a warning message is output.

#pragma constseg

#pragma section

The #pragma directive is deleted and a warning message is output.

#pragma data_alignment

None

The #pragma directive is deleted and a warning message is output.

#pragma dataseg

#pragma section

The #pragma directive is deleted and a warning message is output.

#pragma diag_default

None

The #pragma directive is valid.

#pragma diag_error

None

The #pragma directive is valid.

#pragma diag_remark

None

The #pragma directive is valid.

#pragma diag_suppress

None

The #pragma directive is valid.

#pragma diag_warning

None

The #pragma directive is valid.

#pragma error

None

The #pragma directive is deleted and a warning message is output.

#pragma include_alias

None

The #pragma directive is deleted and a warning message is output.

#pragma inline

#pragma inline / #pragma noinline

Replaced with #pragma inline when forced is specified and with #pragma noinline when never is specified.

Note that even when forced is specified, inline expansion is not always performed.

The target function should be a function in the function declaration subsequent to #pragma inline.

When other than a function declaration follows, an error will occur.

When no function declaration follows, the #pragma directive is deleted and a warning message is output.

Only #pragma inline in the IAR format can be used. #pragma inline in the CC-RL format leads to a compile error.

#pragma language

None

The #pragma directive is deleted and a warning message is output.

#pragma location

#pragma address

Replaced with #pragma address when an absolute address is specified.

The variable name used in #pragma address should be a variable name in the variable declaration subsequent to #pragma location.

When no variable declaration follows, the #pragma directive is deleted and a warning message is output.

Segment names are not supported. They will lead to a syntax error.

#pragma message

None

The #pragma directive is deleted and a warning message is output.

#pragma object_attribute

None

The #pragma directive is deleted and a warning message is output.

#pragma optimize

None

The #pragma directive is deleted and a warning message is output.

#pragma pack

None

The #pragma directive is deleted and a warning message is output.

#pragma __printf_args

None

The #pragma directive is valid.

#pragma required

None

The #pragma directive is deleted and a warning message is output.

#pragma rtmodel

None

The #pragma directive is deleted and a warning message is output.

#pragma __scanf_args

None

The #pragma directive is valid.

#pragma segment

None

The #pragma directive is deleted and a warning message is output.

#pragma section

None

Handled as #pragma section in the CC-RL.

When written in a format different from that in the CC-RL specifications, the #pragma directive is deleted and a warning message is output.

#pragma STDC CX_LIMITED_RANGE

None

The #pragma directive is deleted and a warning message is output.

#pragma STDC FENV_ACCESS

None

The #pragma directive is deleted and a warning message is output.

#pragma STDC FP_CONTRACT

None

The #pragma directive is deleted and a warning message is output.

#pragma type_attribute

None

The #pragma directive is deleted and a warning message is output.

#pragma unroll

None

The #pragma directive is deleted and a warning message is output.

#warning

None

The #pragma directive is valid.

_Pragma()

None

Handled as a normal function call.

__CORE__

None

The macro is enabled.

Becomes one of the following values according to the specification of the -cpu option.

-

__RL78_0__ (when S1 is specified by the -cpu option)

-

__RL78_1__ (when S2 is specified by the -cpu option)

-

__RL78_2__ (when S3 is specified by the -cpu option)

__RL78_0__

__RL78_S1__

The macro is enabled (value is 1).

__RL78_1__

__RL78_S2__

The macro is enabled (value is 2).

__RL78_2__

__RL78_S3__

The macro is enabled (value is 3).

__CODE_MODEL__

None

The macro is enabled.

Becomes one of the following values according to the specification of the -memory_model option or -cpu option.

-

__CODE_MODEL_NEAR__ (when small is specified by the -memory_model option or when S1 is specified by the -cpu option while the -memory_model option is not specified)

-

__CODE_MODEL_FAR__ (when medium is specified by the -memory_model option or when other than S1 is specified by the -cpu option while the -memory_model option is not specified)

__CODE_MODEL_NEAR__

__RL78_SMALL__

The macro is enabled (value is 1).

__CODE_MODEL_FAR__

__RL78_MEDIUM__

The macro is enabled (value is 2).

__DATA_MODEL__

None

The macro is enabled.

The value becomes __DATA_MODEL_NEAR__ regardless of the specification of the -cpu option.

__DATA_MODEL_NEAR__

__RL78_SMALL__

The macro is enabled (value is 1).

__DATA_MODEL_FAR__

None

The macro is enabled (value is 2).

__func__

None

The macro is enabled.

__FUNCTION__

None

The macro is enabled.

__PRETTY_FUNCTION__

None

The macro is enabled.

__IAR_SYSTEMS_ICC__

None

The macro is enabled (value is 8).

__ICCRL78__

None

The macro is enabled (value is 1).

__BUILD_NUMBER__

__cplusplus

__DOUBLE__

__embedded_cplusplus

__LITTLE_ENDIAN__

__SUBVERSION__

__VER__

None

Handled as a user-defined macro.

Standard library functions

fabsl

acosl

asinl

atanl

atan2l

ceill

cosl

coshl

expl

floorl

fmodl

frexpl

ldexpl

logl

log10l

modfl

powl

sinl

sinhl

sqrtl

tanl

tanhl

strtold

None

Replaced with the following function names.

fabs

acos

asin

atan

atan2

ceil

cos

cosh

exp

floor

fmod

frexp

ldexp

log

log10

modf

pow

sin

sinh

sqrt

tan

tanh

strtod

The location for writing the __near or __far keyword in a function declaration or function pointer declaration conforms to the CC-RL specifications.

Standard library functions supported by CC-RL

Standard library functions

Conforms to the CC-RL specifications.

The location for writing the __near or __far keyword for a function or function pointer in its declaration conforms to the CC-RL specifications.

Standard library functions

Others

None

Not supported.

Handled as a normal function call.

When an unsupported header file is included, a compile error will occur.

Standard library

Macro

Standard library

Macro

A macro with the same name as a macro defined in the header file of the CC-RL conforms to the CC-RL specifications.

Other macros are not supported. They are handled as user-defined macros.

[Example of use]

-

To enable the function for supporting transition of programs written for ca78k0r, describe as:

>ccrl -convert_cc=ca78k0r -cpu=S2 -dev=dr5f100pj.dvf main.c