Can codewarrior generate an error when the function is not found in the head files?

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

Can codewarrior generate an error when the function is not found in the head files?

779 次查看
hongjianzhang
Contributor III

We found that when I use a function that is not decleared in header files but are in other soure files, the cw just couldn't generate an error and it may lead to some value are not right, and sometimes we could'n find until the product has been used for a while, we need the cw generate an error to prevent this problem happen again.

标签 (1)
4 回复数

571 次查看
niba
Contributor III

Just enable all compiler warnings (-w on -w all). And you will receive the compiler error "function has no prototype".

571 次查看
martin_kovar
NXP Employee
NXP Employee

Hello,

could you please clarify, which device and CodeWarrior you use?

Regards,

Martin

0 项奖励

571 次查看
hongjianzhang
Contributor III

we are using mc9s12hy64 & mc9s12xet256 and our develop tool is codewarrior 5.9

0 项奖励

571 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello hongjian,

We have report this problem to the comipler tool team many years ago,

while they think this is not a bug, we  should refer to the ANSI  standard to write code .

So we should declared the function , includes the header file , then there will be no error call.

BR

Alice