Why return function is an error in CodeWarrior?

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

Why return function is an error in CodeWarrior?

1,325 次查看
joonsinchu
Contributor II


Dear all,

 

Why am i keep getting this error by using return function in my coding?

 

can anyone explain and help me further on this CRC checksum coding ?

 

 

 

Your early reply is much appreciated.

 

Thank you.

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

1,217 次查看
BlackNight
NXP Employee
NXP Employee

Hi Joonsin,

you cannot return a value in a function which has a return type of 'void'.

So instead

void crc16(void) {

you have to write

int crc16(void) {

And the AS1_SencChar() after the return does not make any sense.

All these are basic C programming points.

I hope this helps,

Erich

0 项奖励
回复