Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

A problem about using long type pointer

$
0
0

I use CCS v5.0 to compile ARM code of OMAPL138 and I find that when I define a long type pointer as "long *plData;" and give it an address that is not the multiple  of 4, the value *plData is wrong.

e.g.:

unsigned char aucData[6]={1,2,3,4,5,6};
unsigned char *pucData = aucData+2;
unsigned long *pulData = (unsigned long *)pucData;
 unsigned long ulData;


ulData = *pulData;

I found the value of ulData was 0x02010403,but the value 0x06050403 was my expectation.

Because there is not the same problem in other compilers such as IAR,VC,I wonder how I can solve it.Thanks!


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>