Skip to main content
Renesas Singapore - Knowledgebase

Message W0520171 (CC-RL)

Last Updated:05/10/2017


I am using the CC-RL compiler for RL78 devices. When substituting the value of a RAM address for a pointer, I get the warning “W0520171: Invalid type conversion”. How can I resolve this?

unsigned char  *p; p = (unsigned char *)0xffd00;


This message appears because you have tried to substitute a value that is a 5-digit hexadecimal number for a pointer with the near attribute.

The address range for access to variables by pointers with the near attribute in CC-RL is 0xf0000 to 0xfffff. You have input a value in the range from 0x0000 to 0xffff, that is, a value without f as the fifth digit.

Accordingly, if you have a value with f as the fifth digit, input a hexadecimal value without f as the fifth digit instead.

p = (unsigned char *)0xfd00;

Change the pointer to have the far attribute when the range of address values is not in the range from 0xf0000 to 0xfffff.

__far unsigned char  *p;
p = (__far unsigned char *)0x1fd00;

Suitable Products
e² studio
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 Family
  • Was this article helpful?