English
Language : 

CC78K4 Datasheet, PDF (452/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
11.6 Modifications of C Source
By using the extended functions of this C compiler, efficient object generation can be realized. However, these
extended functions are intended to cope with the 78K/IV Series. So, to use them for other devices, the C source may
need to be modified. Here, how to make the C source portable from another C compiler to this C compiler and vice
versa is explained.
From another C compiler to this C compiler
• #pragmaNote
If the other C compiler supports the #pragma preprocessing directive, the C source must be modified. The
method and extent of modifications to the C source depend on the specifications of the other C compiler.
• Extended specifications
If the other C compiler has extended specifications such as addition of keywords, the C source must be
modified. The method and extent of modifications to the C source depend on the specifications of the other C
compiler.
Note #pragma is one of the preprocessing directives supported by ANSI. The character string following
#pragma is identified as a directive to the compiler. If the compiler does not support this directive, the
#pragma directive is ignored and compilation will continue until it properly ends.
From this C compiler to another C compiler
Because this C compiler has added keywords as the extended functions, the C source must be made portable to
the other C compiler by deleting such keywords or delimiting them with #ifdef.
EXAMPLE
<1> To invalidate a keyword (same applies to callf, sreg, noauto, and norec etc.)
#ifndef
_ _K4_ _
#define callt
/* makes callt an ordinary function */
#endif
<2> To change from one type to another
#ifndef
_ _K4_ _
#define bit char
#endif
/* changes bit type to char type variable */
452
User’s Manual U15556EJ1V0UM