This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] for PR 17949
Hello,
> > I am not quite sure whether may_be_unaligned_p is correct.
>
> It isn't. It's only going to work for structures for which
> all elements are packed. It isn't going to work for
>
> struct S {
> int x;
> char y;
> int z __atribute__((packed));
> };
>
> You need to look at the DECL_ALIGN for the FIELD_DECL. I believe
> that all you need is to look at the outermost such FIELD_DECL.
I don't understand your example (there is no array in it?)
However the function as it is is true for
typedef struct
{
short bla;
int f[17] __attribute__ ((packed));
} A;
Zdenek