 |
|
 |
MESC TOOL NEWS:
MESCT-NC308WA_2-991001D
NC308WA and NC30WA
Precautions
|
Please take note of the following problem in using C compilers (with assembler and integrated development environment) NC308WA for the M16C/80 series and NC30WA for the M16C/60 and 20 series of microcomputers.
- Versions Concerned
NC308WA V.1.00 Release 1
NC30WA V.2.00 Release 1 -- V.3.10 Release 1
- Problem
When a conditional branch statement including a return statement with no return value is described in a function with a return value, exceptions may occur at compilation, which results in the compiler being forcedly terminated.
- Conditions
This problem occurs if the following three conditions are satisfied:
- (1)A conditional branch statement is described in a function where a return value is defined
- (2)If the condition of the branch is true, only a return statement that returns a value is executed.
- (3)If the condition of the branch is false, a statement that assigns a constant and a return statement that returns no value (or the ending portion of the function with no return statement) are executed.
[Example]
----------------------------------------------------------------------
| char x;
|
| char func(void)
| {
| if (x) (1)
| return 1; (2)
| x = 1; (3)
| } (3)
----------------------------------------------------------------------
- Workaround
Ensure that a return value is described within a return statement in a function that returns a value. Also, explicitly describe a return statement that returns a value, at the end of the function.
|
 |