C1860: Pointeer conversion: Possible loss of data

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C1860: Pointeer conversion: Possible loss of data

Jump to solution
2,077 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
1,358 Views
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

 

View solution in original post

0 Kudos
Reply
1 Reply
1,359 Views
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 Kudos
Reply