This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53037] warn_if_not_aligned(X)
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 04 Jun 2017 23:47:02 +0000
- Subject: [Bug c/53037] warn_if_not_aligned(X)
- Auto-submitted: auto-generated
- References: <bug-53037-4@http.gcc.gnu.org/bugzilla/>
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.)