 |
|
 |
MESC TOOL NEWS:
MESCT-NC30WA_1-981001D
NC30WA, NC30 NC77WA, NC77 NC79WA, NC79 Precautions
|
Please take note of the following problem in using C compilers NC30WA and NC30 for the M16C/60 series, NC77WA and NC77 for the 77XX series, and NC79WA and NC79 for the 7900 series of microcomputers. You are kindly requested to circumvent this problem by the workaround described below.
This problem, however, has already been eliminated in NC30WA V.3.00 Release 1 and later, NC77WA V.5.00 Release 1, and NC79WA V.3.00 Release 1.
Problem: Expressions may not correctly be evaluated using conditionally compile statement "#if".
- Versions Concerned
| Product Name | Versions Concerned |
| NC30WA, NC30 | V.1.00 Release 1 to V.2.00 Release 1 |
| NC77WA, NC77 | V.3.00 Release 1 to V.4.00 Release 1 |
| NC79WA, NC79 | V.2.00 Release 1 to V.2.00 Release 2 |
- Description
When two constants in a constant expression are compared in conditionally compile statement "#if" or "#if . . . defined", the expression may not correctly be evaluated if a zero is included within one of the constants.
- Conditions
This problem occurs if the following two conditions are satisfied:
- A constant expression is evaluated in a "#if" or "#if . . . defined" statement.
- One of the constants in the expression includes a zero after its second numeral.
- Phenomena
The constant including a zero cannot correctly be recognized in the constant expression.
- Example
[C Source File]
-----------------------------------------------------------------------
#define D1 512
#define D2 4096
#if D1 < D2
#define MES "TYPE D1"
#else
#define MES "TYPE D2"
#endif
main()
{
func(MES); /* Character string "TYPE D2" is passed */
}
-----------------------------------------------------------------------
- Workaround
Please use the "if" or "switch" statement in place of "#if" since this problem occurs only when a constant expression is evaluated by preprocessor command "#if" or #if . . . defined".
|
 |