Skip to main content
Renesas Electronics America - Knowledgebase

W0520171 Error Message: (RL78 CC-RL)

Latest Updated:12/05/2016


While using the RL78 CC-RL Compiler, I get the error message “W0520171: Invalid type conversion” when I try to store an address value in the unsigned long type variable assigned to a pointer. How do I resolve it? My code looks similar to the example below:

unsigned long a;
unsigned char *p;
p = (unsigned char *)a;


The error "“W0520171: Invalid type conversion” message appears because code directs the 4-byte value to be stored to the near attribute pointer. The pointer should point to the far attribute to store the address of the 4-byte value.

unsigned long a;
__far unsigned char *p;
p = (__far unsigned char *)a;

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