C1860: Pointeer conversion: Possible loss of data

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

C1860: Pointeer conversion: Possible loss of data

ソリューションへジャンプ
2,101件の閲覧回数
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,382件の閲覧回数
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,383件の閲覧回数
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 件の賞賛
返信