This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Forward declarations and variable alignment weirdness
> > 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 this actually causes failures depends on the context, and you can
construct code that fails either way. In practice giving the definition greater
alignment than the declaration will probably lead to sub-optimal code rather
than active borkage.
Paul