 |
|
 |
RENESAS TOOL NEWS on February 1, 2005: RSO-M3T-NC308WA_2-050201D
A Note on Using C-Compiler Packages M3T-NC308WA and M3T-NC30WA
--On Calling a Function Declared to Be typedef and Returning a Structure--
|
Please take note of the following problem in using the M3T-NC308WA and
M3T-NC30WA C-compiler packages which are used for the M16C family of MCUs:
- On calling a function declared to be typedef and returning a structure
- Versions Concerned
M3T-NC308WA V.5.00 Release 1 through V.5.20 Release 1
(for the M32C/90, M32C/80, and M16C/80 series)
M3T-NC30WA V.5.00 Release 1 through V.5.30 Release 1
(for the M16C/60, M16C/30, M16C/20, M16C/10, M16C/Tiny,
and R8C/Tiny series)
- Description
Declaring a function or a pointer to a function that returns a
structure to be typedef and then calling this function result in
incorrect code being generated.
- 2.1 Conditions
- This problem occurs if the following conditions are all satisfied:
| (1) | A function or a pointer to a function that returns a structure is declared to de typedef. |
| (2) | Then the function in (1) is called. |
- 2.2 Example:
----------------------------------------------------------
struct S{
int i;
};
typedef struct S (FUNC)(char);
typedef FUNC* FP;
FP obj1;
-----------------------------------------------------------
- Workaround
Don't declare a function or a pointer to a function that returns a structure to be typedef.
Example:
----------------------------------------------------------
struct S{
int i;
};
struct S (*obj1)(char );
----------------------------------------------------------
- Schedule of Fixing the Problem
This problem has already been fixed in the M3T-NC30WA V.5.30 Release 02 and later.
|
 |