I'm trying to store a map of addresses in an array.
The following code snippet works as expected on my STM32F767ZI, but compiles with a warning...
intptr_t addressMap[2];
int* a=NULL;
int* b=NULL;
*a=10;
*b=20;
addressMap[0]=(intptr_t) a;
addressMap[1]=(intptr_t) b;
int* c=addressMap[0];
compiles with a warning:
initialization makes pointer from integer without a cast [-Wint-conversion]
at the last line (int* c=addressMap[0];
).
I also tried uint32_t
and int32_t
as the data type of the addressMap
array. Same warning.
According to this document (http://www.keil.com/support/man/docs/armcc/armcc_chr1359125009502.htm) addresses are 32 bit wide (as expected).
How may I write my code without this warning?