Error: Attempt to read uninitialised memory location.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error: Attempt to read uninitialised memory location.

Jump to solution
755 Views
AW60
Contributor I

Hi all,

I am usinh AW60 with codeworrier. I have defined  a gloabal variable in .C file and reading this variable in other .c file. But when i simulate this program with codeworrier i get above error. What is reason for tis error & how can i solve it?

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
609 Views
bigmac
Specialist III

Hello,

 

As the message says, the debugger is warning that you are attempting to read a memory location that may contain random garbage because it has not yet been initialised.  This suggests that you may have disabled ANSI initialisation of global variables when you created the project.  Your code will then need to explicitly initialise the variable before attempting to read.

 

This only applies to simulation mode.  For the real hardware, the read will return the garbage value.

 

Regards,

Mac

View solution in original post

0 Kudos
Reply
1 Reply
610 Views
bigmac
Specialist III

Hello,

 

As the message says, the debugger is warning that you are attempting to read a memory location that may contain random garbage because it has not yet been initialised.  This suggests that you may have disabled ANSI initialisation of global variables when you created the project.  Your code will then need to explicitly initialise the variable before attempting to read.

 

This only applies to simulation mode.  For the real hardware, the read will return the garbage value.

 

Regards,

Mac

0 Kudos
Reply