CWv8 byte pointer

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

CWv8 byte pointer

2,064件の閲覧回数
admin
Specialist II
I use CW for 56800E. In the following line I try to store address in bytes of name2 into var_addr (e.g. if name2 address 0x13b -> var_addr=0x276).
const int var_addr = (const int)((byte*)&name2);
In version 7.3 this code works fine
In version 8 (byte*) convertion seems to be ignored and in var_addr is word pointer (i.e. 0x13b)
Is this a compiler bug or I missed something?
ラベル(1)
タグ(1)
0 件の賞賛
返信
2 返答(返信)

454件の閲覧回数
admin
Specialist II
I contacted freescale support and received the answer.
This is a problem of compiler. It appeares if we initialize the variable for address inside a function.
So, wait bug fixes.
Also i get the following (temporarily) solution:

We must define global variables outside a function, but we can initialize them inside a function.
0 件の賞賛
返信

454件の閲覧回数
Alban
Senior Contributor II
Thanks for informing us of the progress Alexey !
I'll be careful now :smileytongue:
 
Alban.
0 件の賞賛
返信