Forum Discussion
Altera_Forum
Honored Contributor
15 years agoActually that one tries to apply the attribute to pvar, not *pvar.
Define a type that has the attribute attached, otherwise it is difficult to get it applied to the right place (even when it does work). A structure containing a single alignment-contrained integer does work. So maybe you need: typedef struct { int v __attribute__((aligned(2))); } int_aligned_16_t; and use that inside the other structures - so you only look at the 'v' member when you want the value itself.