Renesas Technology, Tools FAQs
Document Number: 01051104_e
Q.
When I initialize the variables declared by char with Oxaa, I get the following warning, "constant out of range due to...". Why?
A.
When signed/unsigned is not specified in the char type, char is assumed to be signed. Therefore, its value range is from -128 to 127
in decimal format. But, the 0xaa is 170 in decimal format, which is obviously out of the char range. Therefore, the compiler
generates codes that round down 0xaa to the char range, and loads -86 into the variable in decimal format.
To avoid this warning, you should either declare the variable as unsigned char, or modify the variable to fit within the char
declaration value range.
Top of Page | Back to Previous Page
Terms of Use Privacy Policy
(C)2004 Renesas Technology Corp., All Rights Reserved.
Comentarios a estos manuales