 |
|
 |
MESC TOOL NEWS:
MESCT-NC308-990516D
NC308WA, NC30WA, NC79WA, and NC77WA
Precautions
|
Please take note of the following problems in using C compilers (with assembler and integrated development environment) NC308WA, NC30WA, NC79WA, and NC77WA for the Mitsubishi 16-bit microcomputers.
Products Concerned
| MCUs Supported | Product Name | Versions |
| M16C/80 Series | NC308WA | V.1.00 Release 1 |
M16C/60 Series M16C/20 Series | NC30WA (NC30) | V.1.00 Release 1 -- V.3.10 Release 1 |
| 7900 Series | NC79WA (NC79) | V.2.00 Release 1 -- V.3.10 Release 1 |
| 77xx Series | NC77WA (NC77) | V.3.00 Release 1 -- V.5.10 Release 1 |
Problem on Arrays of Type far with Initial Values
- Description
"System Errors" occur if the number of elements of an array of type far with initial values is greater than 32767.
- Conditions
This problem arises if the following two conditions are satisfied:
(1) An array of type far has been initialized.
(2) The number of elements (subscripts) of the array is greater than 32767.
- Example
[C Source File]
--------------------------------------------------------------------
| const unsigned short far ch[35000] = {0,1,2,3,4,5,6,7,8,9};
|
--------------------------------------------------------------------
- Workaround
Divide the array in such a way that the number of elements of each array is equal to or less than 32767.
[C Source File]
--------------------------------------------------------------------
| const unsigned short far ch1[30000]={0,1,2,3,4,5,6,7,8,9};
| const unsigned short far ch2[5000];
|
--------------------------------------------------------------------
NC308WA, NC30WA, NC79WA, and NC77WA Precautions MESCT-NC308-990516D
Problem on "sizeof" Operator
- Description
Compiling programs described with sizeof operators may cause "Page Faults" or "Core Dumps" to be generated.
- Conditions
This problem arises if the following two conditions are satisfied:
(1) At the beginning of descriptions, an extern declaration is made with no initial value.
(2) After the sentence of the declaration, the declared variable is assigned an initial value described as "sizeof(a character string)".
- Example
[C Source File]
--------------------------------------------------------------------
| extern int i;
| int i = sizeof( "abcde" );
|
--------------------------------------------------------------------
- Workaround
Circumvent this problem by using either of the following methods.
(1) Make an extern declaration after the sizeof operator.
[C Source File]
-----------------------------------------------------------------
| int i = sizeof( "abcde" );
| extern int i;
|
-----------------------------------------------------------------
(2)Make an extern declaration in a different file from the one where the initial value is described (the one where the substance is defined).
[C Source File]
-----------------------------------------------------------------
| [file:samp.h]
| extern int i;
|
|
| [file:source.c]
| #include "samp.h"
| int I = sizeof( "abcde" );
|
-----------------------------------------------------------------
|
 |