Error: Attempt to read uninitialised memory location.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Error: Attempt to read uninitialised memory location.

ソリューションへジャンプ
621件の閲覧回数
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?

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
475件の閲覧回数
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 件の賞賛
返信
1 返信
476件の閲覧回数
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 件の賞賛
返信