跳转到主内容
Knowledgebase
Home
Renesas Electronics China - Knowledgebase

W0520171 Error Message: (RL78 CC-RL)

Latest Updated:12/05/2016

Question:

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:

<Example>
unsigned long a;
unsigned char *p;
p = (unsigned char *)a;

Answer:

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.

<Example>
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
  • 这篇文章对您有帮助吗?