 |
|
 |
MESC TOOL NEWS:
MESCT-NC308WA_3-010216D
NC308WA, NC30WA, NC79WA and NC77WA Precautions
|
Please take note of the following problems in using C compilers with an assembler and integrated development environment NC308WA, NC30WA, NC79WA, and NC77WA.
- On declaring type "enum"
- On the function-extending #pragma STRUCT directive
- Problem on Declaring Type "enum"
- 1.1 Versions Concerned
-
- C compiler for the M16C/80 series MCUs:
- NC308WA V.1.00 Release 1 -- V.3.10 Release 1
- C compiler for the M16C/60 and M16C/20 series MCUs:
- NC30WA V.1.00 Release 1 -- V.4.00 Release 1
- C compiler for the 7900 series MCUs:
- NC79WA V.1.00 Relaese 1 -- V.4.10 Release 1
- C compiler for the 77xx series MCUs:
- NC77WA V.3.00 Relaese 1 -- V.5.20 Release 4
- 1.2 Description
- Declaration of type "enum" with no tag name causes an error to appear which says "This program has performed an illegal operation . . . ." in Windows.
- 1.3 Conditions
- This problem occurs if the following two conditions are satisfied:
- (1) A pointer to type "enum" or an array of type "enum" with no tag name is declared.
- (2) Either of the following is performed using the pointer or array described in (1):
- (a) an assignment or comparison operation
- (b) a prototype declaration
- Note: Using the enum value itself, not the pointer to it, is free from this problem.
- 1.4 Example
-
-----------------------------------------------------------------
enum {A_1,A_2} *ap; /* Condition (1) */
enum {B_1,B_2} *bp; /* Condition (1) */
ap = bp; /* Assignment operation: condition (2)-(a) */
ap < bp; /* Comparison operation: condition (2)-(a) */
ap != bp; /* Comparison operation: condition (2)-(a) */
void f(enum {C_1,C_2} *); /* Prototype declaration:
condition (2)-(b) */
void func(void){
f(ap);
}
-----------------------------------------------------------------
- 1.5 Workaround
-
Make sure to declare type "enum" with a tag name.
-----------------------------------------------------------------
enum e_a {A_1,A_2} *ap; /* Tag name "e_a" described */
enum e_b {B_1,B_2} *bp; /* Tag name "e_b" described */
:
-----------------------------------------------------------------
- 1.6 Schedule of Fixing Problem
- We plan to fix this problem in our next release.
NC308WA, NC30WA, NC79WA and NC77WA Precautions MESCT-NC308WA_3-010216D
- Problem on the Function-Extending #pragma STRUCT Directive
- 2.1 Versions Concerned
-
- C compiler for the M16C/80 series MCUs:
- NC308WA V.1.00 Release 1 -- V.3.10 Release 1
- C compiler for the M16C/60 and M16C/20 series MCUs:
- NC30WA V.1.00 Release 1 -- V.4.00 Release 1
- C compiler for the 7900 series MCUs:
- NC79WA V.2.00 Relaese 1 -- V.4.10 Release 1
- C compiler for the 77xx series MCUs:
- NC77WA V.3.00 Relaese 1 -- V.5.20 Release 4
- 2.2 Description
- If "#pragma STRUCT tag name unpack" is described in front of an array of structures, no data designated as being unpack can be accessed properly.
- 2.3 Conditions
- This problem occurs if the following two conditions are satisfied:
- (1) An array of structures including members of type char is declared.
- (2) "#pragma STRUCT tag name unpack" is described in front of an array of structures in (1) above.
- 2.4 Example
-
-----------------------------------------------------------------
#pragma STRUCT S unpack /* Condition (2) */
struct S{
char c; /* Condition (1) */
int i;
};
struct S s[3] = {{1,2},{3,4},{5,6}};
-----------------------------------------------------------------
- 2.5 Workaround
- Do not use "#pragma STRUCT tag name unpack" for an array of structures including members of type char.
- 2.6 Schedule of Fixing Problem
- We plan to fix this problem in our next release.
|
 |