Martin Sebor <msebor at gcc dot> changed:

           What    |Removed                     |Added
           Keywords|                            |diagnostic
             Status|RESOLVED                    |ASSIGNED
   Last reconfirmed|                            |2018-02-02
                 CC|                            |msebor at gcc dot
         Resolution|INVALID                     |---
           Assignee|unassigned at gcc dot      |msebor at gcc dot
     Ever confirmed|0                           |1

--- Comment #5 from Martin Sebor <msebor at gcc dot> ---
(In reply to Paul Eggert from comment #4)
> Here, GCC says the alignment of 'b' is 1, not 8. What happened to the
> attribute?

GCC silently drops it, without validating it.  For instance, this is accepted
as well:

  struct s { char mem; };

  struct __attribute__ ((foobar))
  s b;

I view it as a bug.  At a minimum, GCC should point out that it's ignoring the
attribute like other compilers do, such as Clang:

  warning: unknown attribute 'foobar' ignored [-Wunknown-attributes]

I happened to notice this bug while testing a fix for pr84108.  It seems that a
simple fix is fairly straightforward so hopefully Richard won't be offended if
I reopen this bug, assign it to myself, and submit my patch in stage 1 of GCC

Reply via email to