Indirection to different types

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

Indirection to different types

2,948 Views
calou
Contributor III
Hello,
 
I have this definition :
SBYTE const SUIVANT[6]={'S','U','I','V',1,0};
 
I call the function LCDPutString(SUIVANT,2,15) which is defined like it :
void LCDPutString(SBYTE *s,BYTE lgn,BYTE pos)
 
When i compile i have this warning : Indirection to different types ('const signed char *' instead of 'signed char *')
 
I undestand this warning but would it be possible to do something to avoid it? I could declare SUIVANT not in const but i will lose ram. The LCDPutString can receive other arguments that const arguments.
 
How can i do?
 
Thank you very much
Regards
Labels (1)
0 Kudos
2 Replies

651 Views
calou
Contributor III
Thank you for your answer. The content of s is not changed
 
Regards
0 Kudos

651 Views
CompilerGuru
NXP Employee
NXP Employee
Does LCDPutString ever change its first argument? Given the name of the function I would not expect this.
If it does never change the s parameter, you can add the const there as its not a problem to call "const SBYTE *"'s with a "SBYTE *", only the other way around does cause the warning.

Daniel
0 Kudos