Forum Discussion
Altera_Forum
Honored Contributor
15 years agoPointer help - alignment issue
I need to use a pointer to a long that is not word aligned (I think). Here is sample code void func(void) { char Test[12] = { 1, 2, 3,4 ,5 ,6, 7, 8, 9, 10, 11, 12}; long * temp; ...
Altera_Forum
Honored Contributor
15 years agoThanks for the response. I could not get the __attribute__ to work. No error but the same results. I have never used it so maybe I did something wrong. I realized that both words would have to be read and adjusted. My fall back is to cast to a char* and run a loop of 4.
I had a structure that was packed. One of the items gets cast as a void * and then back to a int *. When that happens apparently the alignment is lost.