Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHere are other examples: http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/type-attributes.html
I would expect your results to be the same since if you align that array to a 4 byte boundary then when you start casting the char pointer to a long for elements [1], [2], [3], [5], [6], etc... of the char array and then performing 32-bit access based on those locations you are performing unaligned accesses again. In the end what are you trying to do? (i.e. what are you trying to do in your real code that caused you to write this test code?)