Re: Forward declarations and variable alignment weirdness

2010-08-22 Thread Paul Brook
> > PR45112. See also http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00283.html > > Thanks a lot for info. > If I got the discussion right, it's ok for the definition to use more > strict alignment than the declaration. Not quite. Any mismatch is user error, and may cause nasal daemons. Whether thi

Re: Forward declarations and variable alignment weirdness

2010-08-21 Thread Piotr Jaroszyński
2010/8/21 Paul Brook : >> I have run into variable alignment issues, which turned out to be >> caused by forward declaration w/o the aligned attribute repeated. > >> Could someone explain this please? If it's a bug to not include the >> aligned attribute in the forward declaration, would it be hard

Re: Forward declarations and variable alignment weirdness

2010-08-20 Thread Paul Brook
> I have run into variable alignment issues, which turned out to be > caused by forward declaration w/o the aligned attribute repeated. > Could someone explain this please? If it's a bug to not include the > aligned attribute in the forward declaration, would it be hard to add > a warning for that

Re: Forward declarations and variable alignment weirdness

2010-08-20 Thread Piotr Jaroszyński
2010/8/20 Piotr Jaroszyński : > Let me walk you through simple testcases showing different alignments > I see for "misaligned" on gcc 4.4.4 and 4.5.1. Forgot to mention the results are for x86_64. -- Best Regards Piotr Jaroszyński

Forward declarations and variable alignment weirdness

2010-08-20 Thread Piotr Jaroszyński
Hello, I have run into variable alignment issues, which turned out to be caused by forward declaration w/o the aligned attribute repeated. Let me walk you through simple testcases showing different alignments I see for "misaligned" on gcc 4.4.4 and 4.5.1. Common type definition: struct foo { cha