Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/24/02 11:56
Read: times


 
#26254 - RE: initialization of RAM in C
"the Keil 'C' startup code clear all memory (set it to 0)."

Yes - but make sure it's configured correctly (as described in the Manual) [1]

"I believe that all compilers I have worked with do the same."

Yes, it is generally true that the 'C' runtime support will clear RAM at startup; but note that very important point - only at startup.
This means that you cannot rely on automatic variables (eg, locals within functions) to be zero at any arbitrary time during the program's execution. The actual value will depend on what happens to be left in that RAM location by whatever used it last...
(I don't think even Peter's idea would necessarily pick up problems due to this?)

[1] I'm sure that Erik knows that already; but, for the benefit of others, ...

List of 8 messages in thread
TopicAuthorDate
initialization of RAM in C            01/01/70 00:00      
RE: initialization of RAM in C            01/01/70 00:00      
RE: initialization of RAM in C            01/01/70 00:00      
RE: initialization of RAM in C            01/01/70 00:00      
RE: initialization of RAM in C            01/01/70 00:00      
RE: initialization of RAM in C            01/01/70 00:00      
RE: initialization of RAM in C            01/01/70 00:00      
RE: initialization of RAM in C            01/01/70 00:00      

Back to Subject List