 |
|
 |
RENESAS TOOL NEWS on July 1, 2004: RSO-M3T-NC308WA_2-040701D
A Note on Using C Compiler Packages
M3T-NC308WA, M3T-NC30WA, M3T-NC79WA and M3T-NC77WA
|
Please take note of the following problem in using the M3T-NC308WA, M3T-NC30WA,
M3T-NC79WA, and M3T-NC77WA C-compiler packages:
- On converting integer constants
- Products and Versions Concerned
M3T-NC308WA V.1.00 Release 1 through V.3.10 Release 3
for the M32C/80 and M16C/80 series MCUs
M3T-NC30WA V.1.00 Release 1 through V.4.00 Release 2
for the M16C/60, M16C/30, M16C/Tiny, M16C/20, M16C/10, and
R8C/Tiny series MCUs
M3T-NC79WA V.2.00 Release 1 through V.4.10 Release 1C
for the 79xx series MCUs
M3T-NC77WA V.3.00 Release 1 through V.5.20 Release 4B
for the 77xx series MCUs
- Description
Extending any integer constant in hexadecimal notation that is
16 bits wide to a 32-bit signed integer constant may generate an
incorrect code at compilation.
- 2.1 Conditions
- This problem occurs if the following four conditions are satisfied:
| (1) | An integer constant is expressed in hexadecimal notation. |
| (2) | The integer constant in (1) is in a range of 0x8000 to 0xFFFF. |
| (3) | The integer constant in (1) is followed by no suffix. |
| (4) | The integer constant in (1) is converted to type signed long. |
- 2.2 Example
-------------------------------------------------------------------
#define AAA (int)0xFFFF /* Conditions (1),(2), and (3) */
void func(void)
{
long l;
l = (long)AAA; /* Condition (4) */
} /* 0x0000FFFF assigned */
-------------------------------------------------------------------
- Workaround
Change the integer constant to that of 32 bits wide in hexadecimal
notation, or express it in decimal notation.
An example of a 32-bit integer constant in hexadecimal notation
-------------------------------------------------------------------
#define AAA (int)0xFFFFFFFFL
void func(void)
{
long l;
l = (long)AAA;
}
-------------------------------------------------------------------
An example in decimal notation
-------------------------------------------------------------------
#define AAA (int)-1
void func(void)
{
long l;
l = (long)AAA;
}
-------------------------------------------------------------------
- Schedule of Fixing the Problem
This problem has been fixed in the M3T-NC308WA and M3T-NC30WA
whose versions are V.5.00 Release 1 and later, so please upgrade
your product to the latest one by visiting Tools Download.
For the M3T-NC79WA and M3T-NC77WA, we plan to fix this problem in our next release of them.
|
 |