메인 콘텐츠로 건너뛰기
Knowledgebase
Home
Renesas Korea

Message W0520171 (CC-RL)

Last Updated:05/10/2017

Question:

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?

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

Answer:

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.

(Example)
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.

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

Suitable Products
e² studio
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 Family
  • 이 기사가 도움이 되셨나요?