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 08:43
Read: times


 
#26237 - RE: initialization of RAM in C
Every variable must be initialized, if its initial state has any influence to the program execution.

This must be done on using assembler and also on using C.

So one of my final tests was, that I change the code inside the startup.a51 to load the whole RAM with 0x77 or 0xFF. Then if it crashes, this was my fault and I must search the unitialized variable, which cause the crash.


Some times it plays no role, if an uninitialized variable was used. E.g. if you shift in 8 bits into a byte, the initial value was completely removed.
But the better programming style was always to initialize such variables also.

So some years later your coworker can easy change to 7 bit without running into your pitfall.

Peter


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