Indirection to different types

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

Indirection to different types

3,717 次查看
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
标签 (1)
0 项奖励
回复
2 回复数

1,420 次查看
calou
Contributor III
Thank you for your answer. The content of s is not changed
 
Regards
0 项奖励
回复

1,420 次查看
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 项奖励
回复