 |
|
 |
RENESAS TOOL NEWS [RSO-M3T-NC308WA-030516D]
A Note on Using C Compilers 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 compilers with an assembler and integrated development environment:
- On standard library functions atof and strtod
- Products and Versions Concerned
- M3T-NC308WA V.1.00 Release 1 -- V.5.10 Release 1
- for the M32C/80 and M16C/80 series MCUs
- M3T-NC30WA V.1.00 Release 1 -- V.5.10 Release 1
- for the M16C/60, M16C/30, M16C/20, and M16C/10 series MCUs
- M3T-NC79WA V.2.00 Release 1 -- V.4.10 Release 1A
- for the 79xx series MCUs
- M3T-NC77WA V.3.00 Release 1 -- V.5.20 Release 4
- for the 77xx series MCUs
- Description
If the argument of a standard library function atof or strtod is a character string beginning with a period (for example, ".12345"), the result of the conversion of the function becomes zero.
- Condition
This problem occurs under the condition that if all the spaces contained in the argument are omitted, its character string begins with a period.
- Example
---------------------------------------------------------------------
#include <stdlib.h>
double d;
int main( void )
{
d = atof( ".12345" ); /* The character string of
the argument begins with a period */
}
---------------------------------------------------------------------
- Workaround
Place a "0" in front of the period.
---------------------------------------------------------------------
#include <stdlib.h>
double d;
int main( void )
{
d = atof( "0.12345" );
}
---------------------------------------------------------------------
- Schedule of Fixing the Problem
We plan to fix this problem in our next release of the products.
|
 |