This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/53037] warn_if_not_aligned(X)


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

--- Comment #22 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warning on the test case in comment #21 looks good to me.  Thanks! 

>From reading comment #1 I'm not sure your patch does quite what you described
there.  It doesn't warn on the declaration of the global object x below:

typedef unsigned long long __u64 __attribute__((aligned(4),
warn_if_not_aligned(8)));

static char c;
static __u64 x;

even though x is 4-byte aligned.  (It does warn when a __u64 member is declared
in a packed struct.)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]