I am trying to byte-align a function to 16-byte boundary using the 'aligned(16)' attribute. I did the following: void __attribute__((aligned(16))) function() { }
(Source: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html)
But when I compile (gcc foo.c ; no makefiles or linker scripts used), I get the following error:
FOO.c:99: error: alignment may not be specified for 'function'
I tried aligning to 4,8,32, etc as well but the error remains the same. I need this to align an Interrupt Service Routine for a powerpc-based processor. What is the correct way of doing so ?