CWv8 byte pointer

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

CWv8 byte pointer

2,062 Views
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?
Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

452 Views
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 Kudos
Reply

452 Views
Alban
Senior Contributor II
Thanks for informing us of the progress Alexey !
I'll be careful now :smileytongue:
 
Alban.
0 Kudos
Reply