2006-03-15 01:13 AM
2006-03-15 12:16 AM
Hi
In fact we have some problems with cosmic c compilers void x(void) { humi_val=humi_val*143 //doesn't give me right results //humi_val is global unsigned int }2006-03-15 12:31 AM
it is just a common optimization. if u do not use this variable anymore compiler omits it.
ok, if u want your code to be compiled as it is, use ''volatile'' definition for such variable. it is just to show u what u want to see, but ussually ''volatile'' is used for several cases only. do not take it as rule for all cases. i work with cosmis since 1 year and did not find any compiler errors.2006-03-15 01:01 AM
thank you for your care
2006-03-15 01:13 AM
Hi.But what means optimizition exactly?how can I solve this problem from cosmic menus?and I know only this means volatile is used for hardware registers because registers is changed externally if I know correctly:).And as you said compiler doesnt optimize volatile variables but I dont know how ı can solve from menu:
If you help me I'd be happier Thank you