C1860: Pointeer conversion: Possible loss of data

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

C1860: Pointeer conversion: Possible loss of data

跳至解决方案
2,076 次查看
Herman
Contributor I

Hello,

I have working code written somewhere in 2004. Now I need a little change and have CW6.3 special edition (just downloaded) to do in with.

The MC9S08GT32 device is used.

 

There's a function:

void mDisplayText(unsigned char cX, unsigned char cY, char *zsTekst)

which is called like

mDisplayText(12, 2, "Batt");

 

Replacing the function with

void mDisplayText(unsigned char cX, unsigned char cY)

mDisplayText(12, 2);

indicates the string parameter is the issue.

 

Now I get the C1860 error. I do understand the error and the pointer thing but don't know how to solve it.

 

Can anyone help?

Thanks in advance

标签 (1)
0 项奖励
回复
1 解答
1,357 次查看
CompilerGuru
NXP Employee
NXP Employee

I assume this warning occurs when building with the tiny memory model.

Was the code originally written for that memory model (or the default small one)?

 

In the tiny memory model in order to point to a flash location use a __far pointer.

 

E.g.:

void mDisplayText(unsigned char cX, unsigned char cY, char *__far zsTekst);

 

 

Daniel

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,358 次查看
CompilerGuru
NXP Employee
NXP Employee

I assume this warning occurs when building with the tiny memory model.

Was the code originally written for that memory model (or the default small one)?

 

In the tiny memory model in order to point to a flash location use a __far pointer.

 

E.g.:

void mDisplayText(unsigned char cX, unsigned char cY, char *__far zsTekst);

 

 

Daniel

 

0 项奖励
回复