4.2.5 Modification of C source

By using expanded function object with high efficiency can be created. However, as expanded function is adapted in RH850 family, C source needs to be modified so as to use in other than RH850 family.

Here, 2 methods are described for shifting to the CC-RH from other C compiler and shifting to C compiler from the CC-RH.

 

<From other C compiler to the CC-RH>

-

#pragmaNote

C source needs to be modified, when C compiler supports the #pragma. Modification methods are examined according to the C compiler specifications.

-

Expanded Specifications
It should be modified when other C compilers are expanding the specifications such as adding keywords etc. Modified methods are examined according to the C compiler specifications.

Note

#pragma is one of the pre-processing directives supported by C90 and C99. The character string next to #pragma is made to be recognized as directives to C compiler. If that directive does not supported by the compiler, #pragma directive is ignored and the compiler continues the process and ends normally.

 

<From the CC-RH to other C compiler>

-

The CC-RH, either deletes key word or divides # fdef in order shift to other C compiler as key word has been added as expanded function.

Example 1.

Disable the keywords

#ifndef __CCRH__
#define interrupt       /*considered interrupt function as normal function*/
#endif

Example 2.

Change to other type

#ifdef  __v850e3v5__
#define _Bool char      /*change _Bool type variable to char type variable*/
#endif