On Dec 19, 2006, at 5:31 PM, Maurizio Vitale wrote:
I'm tying to hunt down the cause of a bug I'm experiencing and it all boils down to a possible misunderstanding on my part on the semantics of the 'aligned' attribute.


Is the 'aligned' attribute supposed to work for objects allocated on the stack (I'm on x86_64, gcc 4.1.1)?

Short answer, no.


Wrong list.  gcc-help is for help with gcc.

Anyway, you also left out some of the relevant details for us to help you, like what OS and what alignment.

Slightly longer answer would be if you want 1, 2, 4 or 8 byte alignment, on most OSes, you're probably Ok.

If you want more than that, allocate your objects with the OS provided aligned memory allocator.

On some OSes, you can also have things 16 byte aligned (darwin, vxworks).

Reply via email to