Wrong overlapping variables in RAM (CW HC08)

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

Wrong overlapping variables in RAM (CW HC08)

ソリューションへジャンプ
2,928件の閲覧回数
elil
Contributor I
Hi,

Recently I found that HC08 C Compiler ovelapped a local automatic variable with a global one, causing the destroy of the global var. In order to prevent it I tried to define the local variable as static and the problem was solved. Another solution was to disable some Optimizer options.
The var. definitions were:
unsigned char *Tx_ptr; // the global var.

typedef union
{
unsigned long l;
unsigned char arr[4];
}adress_format;

adress_format adress; // the local automatic var.
// The adress var. is overlapping *Tx_ptr.

The solution, I found, does not satisfy me, since I haven't found the reason for the problem and the similar problem may be exist in an other place of my code, and I don't want to define all of my local variables as static (it is not economic!).
Any idea is wellcome.

Thank you in advance,
Eli.
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,097件の閲覧回数
CrasyCat
Specialist III
Hello

This should be a corner situation of an configuration issue.
Please submit a service request through our on-line support site to get our
support people take a look at that.

CrasyCat

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,098件の閲覧回数
CrasyCat
Specialist III
Hello

This should be a corner situation of an configuration issue.
Please submit a service request through our on-line support site to get our
support people take a look at that.

CrasyCat
0 件の賞賛
返信
1,097件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
This is either a compiler bug, then use CrazyCats suggestion and file a service request or this is a simple stack overflow. If so, increase the stack size.

Daniel