cancel
Showing results for 
Search instead for 
Did you mean: 

why_cosmic_omits

irmakci2
Associate II
Posted on March 16, 2006 at 05:25

why_cosmic_omits

2 REPLIES 2
irmakci2
Associate II
Posted on March 15, 2006 at 09:07

Hi.Why sometimes cosmic omits some lines in spite of I am writing

sample:

void x(void)

{

y=4;//it is not seen by cosmic!!!ERROR 2 lines

y=6;//y is global variable and cosmic loads 0 in place of 6

if(y

y=512;

}

I am simulating these lines by debugging program ZAP sometimes RIDE

luca239955_st
Associate III
Posted on March 16, 2006 at 05:25

Al ot of emergencies arond there, I see ... 8-)

As Luter explained in another post, you are facing a problem of optimization: you are writing code that does nothing, so the compiler optimizes it away.

If you want to keep such code, for example for practising, you need to declare the variables as ''volatile'' and/or to turn off all optimizations (add -no on the compiler command line, probably there is also a stvd7 menu to do the same thing).

Regards,

Luca