Epson S5U1C17001C Manual page 119

Cmos 16-bit single chip microcomputer, c compiler package for s1c17 family
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

(7) Be sure to include the prototype declaration or the extern declaration of the functions.
If there is no prototype or extern declaration and if a function without its definition part in an earlier part of the
same file is called, the type assumed in the file calling the function may differ from the function type actually
called, resulting in a potential malfunction. Even so, the function will compile without errors.
However, a warning is generated if the definition part of the called function is present in the same file. If the
definition part of the called function is located in another file, no warning is generated unless the -Wall option
is attached.
Since the return value is implicitly assumed to be of the int type, the correct value will not be returned if the
return value has a data type larger than int.
Example:
long l_Val=0x12345678,l_Val_2;
int main()
{
l_Val_2 = sub();
return 0;
}
long sub()
{
long l_wk;
l_wk = l_Val;
return l_wk;
}
(8) Do not use a pointer other than "char" to perform a read/write operations to an odd-number memory.
Failure to observe this warning will result in an address error exception.
Example:
int *ip_Pt;
int sub()
{
ip_Pt = (int *)0x3;
(*ip_Pt) = 0x2;
return 0;
}
(9) Due to the specifications of the C language, note that processing an undefined action can result in different
calculation results due to differences in optimization options (-O0/-O/O3) and local/external variables.
Undefined processing includes the following cases:
・ When overflow is occurring during conversion from floating decimal to integer
・ When shift calculation is performed with a negative value or a value equal to or greater than the bit length of
the calculation target after a type promotion.
S5U1C17001C ManUal
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
// l_Val_2 is substituted with 0x5678.
// Address error exception occurs here.
EPSOn
4 SOUrCE filES
4
SrcFiles
4-15

Advertisement

Table of Contents
loading

Table of Contents