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

cancel
Showing results for 
Search instead for 
Did you mean: 

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

322 Views
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.

Labels (1)
4 Replies

114 Views
niba
Contributor III

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

114 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

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

Regards,

Martin

0 Kudos

114 Views
hongjianzhang
Contributor III

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

0 Kudos

114 Views
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