[Bug c/61447] _Alignof returns incorrect results for some types/archs

bugdal at aerifal dot cx gcc-bugzilla@gcc.gnu.org
Mon Jun 23 01:02:00 GMT 2014


--- Comment #9 from Rich Felker <bugdal at aerifal dot cx> ---
As a related issue (let me know if I should open a new PR), the following code:

struct foo {
    char c;
    alignas(long long) long long ll;

is producing a wrong/nonsensical error with gcc 4.9:

error: '_Alignas' specifiers cannot reduce alignment of 'll'

Apparently (again) GCC wrongly internally thinks the alignment of long long is
8, rather than 4. With earlier gcc versions it simply gives the wrong alignment
(8 rather than 4).

More information about the Gcc-bugs mailing list