Implicit Conversions error

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

Implicit Conversions error

1,393 次查看
Ming
Contributor III
we are having an issue which stopped us from compiling our code. The issue involves a pointer to an union and pass it as an argument into a function. here is a simple example:
 
union A{
  uint 8 one;
  uint8 two;
}
 
union A a; // a is an instance of A
 
void funcB(union A *ptr)
{
}
 
void main(void)
{
 funcB(&a);
}
 
we got an "implicit conversion" error. we are trying to port in our existing code, which works ok on S12 and S16 processor, but not so for coldfire. any ideals?
 
 
 
 
 
 
 
 
 
标签 (1)
0 项奖励
回复
1 回复

722 次查看
CompilerGuru
NXP Employee
NXP Employee
Hmm. Can you copy paste the error message here? Just click in the error message window and press Ctrl-C.

And please also try to compile your sample and also show the errors it generates.
Currently your snippet misses to define uint8, has a space in "uint 8 one" and there is a also a semicolon missing after the union definition. So check if the fixed sample does trigger the compiler error, or maybe the compiler complains about something else.

Daniel
0 项奖励
回复