 |
|
 |
MESC TOOL NEWS:
MESCT-NC30WA-980816D
Please take note of the following problems in using C compiler NC30WA (with assembler AS30 and integrated tool manager TM) and C compiler NC30 for the M16C/60 series of microcomputers.
Products Concerned
- NC30WA V.2.00 Release 1 and V.3.00 Release 1
- NC30 V.2.00 Release 1
On Variables Declared by typedef Statement
- Problem
When an argument of a function is declared using the type defined by a typedef statement, warnings or errors may occur at compilation.
- Conditions
This problem occurs if the following 4 conditions are satisfied:
- A variable type is declared using a typedef statement.
- In the typedef statement is included "far".
- The prototype of a function is declared using the type declared by the typedef statement.
- Arrays [ ] are declared in the prototype arguments.
-----------------------------------------------------------------------
[Example]
typedef unsigned int far UNIT;
void func(UNIT a[]);
void func(UNIT a[])
{
a[2]-1;
}
-----------------------------------------------------------------------
- Workaround
This problem is circumvented by either of the following ways:
- Not using typedef statements
--------------------------------------------------------------------
[Example]
void func(unsigned int far a[]);
--------------------------------------------------------------------
- Describing a prototype argument with an * (pointer), not with an array
--------------------------------------------------------------------
[Example]
void func(unsigned int far *a);
--------------------------------------------------------------------
This problem has been fixed in NC30WA V.3.00 Release 2 that is under production.
NC30WA, NC30 Precautions MESCT-NC30WA-980816D
On Division by 2 at Adding Operation
- Problem
When the result of adding two variables is divided by 2, incorrect codes may be output.
- Conditions
This problem occurs if the following 5 conditions are satisfied:
- An unsigned 1-byte or 2-byte variable is included in the addition.
- The type of the variable to be added is made longer by casting etc.
- The result of the addition is divided by 2 (or right-shifted).
- The result of the operation is stored to the variable at the destination with a shorter type.
- The variable at the destination is the same as the right term of the expression in addition.
-----------------------------------------------------------------------
[Example]
unsigned int i, j;
i = (unsigned int)(((unsigned long)j + i) / 2);
-----------------------------------------------------------------------
- Workaround
If the variable of the right term in addition is the same as the one at the destination, shift the former to the left term of the expression. This problem has been fixed in NC30WA V.3.00 Release 2 that is under production.
|
 |