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

--- Comment #13 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I'd like to point out that the test case

struct sockaddr;
struct sockaddr *f();

struct __attribute__((may_alias)) sockaddr {};
struct sockaddr *f()
{
  return nullptr;
}

(from https://sourceware.org/bugzilla/show_bug.cgi?id=19622#c1)
no longer errors/ICEs and compiles fine with gcc6/trunk.  It used to ICE since
r222419 and the ICE was fixed in r234768.

But we still warn on

__attribute__((may_alias)) struct S s;
struct S { int i; } s2;

w.c:1:35: warning: ignoring attributes applied to ‘struct S’ after definition
[-Wattributes]
 __attribute__((may_alias)) struct S s;
                                   ^
So I suppose we still need the new pragma.

Reply via email to