[Bug c/88172] attribute aligned of zero silently accepted but ignored

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 23 17:57:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88172

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Clang rejects the test case with the following errors:

t.c:1:17: error: requested alignment is not a power of 2
__attribute__ ((aligned (0))) void f (void);
                ^        ~
t.c:4:17: error: requested alignment is not a power of 2
__attribute__ ((aligned (0))) int i;
                ^        ~
t.c:7:17: error: requested alignment is not a power of 2
__attribute__ ((aligned (0))) typedef int Int0;
                ^        ~
t.c:11:17: warning: '_Alignof' applied to an expression is a GNU extension
[-Wgnu-alignof-expression]
_Static_assert (_Alignof (i) == _Alignof (int), "#4");


More information about the Gcc-bugs mailing list