Skip to main content
irmakci2
Associate III
Mar 16, 2006 4:25 AM UTC
Question

why_cosmic_omits

Posted on March 16, 2006 at 05:25

why_cosmic_omits

This topic has been closed for replies.

2 replies

irmakci2
irmakci2Author
Associate III
Mar 15, 2006 8:07 AM UTC
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 II
Mar 16, 2006 4:25 AM UTC
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