This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61939] warn when __attribute__((aligned(x))) is ignored
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 30 Jul 2017 18:24:24 +0000
- Subject: [Bug c/61939] warn when __attribute__((aligned(x))) is ignored
- Auto-submitted: auto-generated
- References: <bug-61939-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61939
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-07-30
CC| |egallager at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
I had to modify the original testcase a bit to get it to compile:
$ cat 61939.c
struct some_struct { int foo; };
void copy_something(void *p, const void *s) {
struct some_struct __attribute__((aligned(8))) *_d = p;
struct some_struct __attribute__((aligned(8))) *_s = s;
*_d = *_s;
}
$ /usr/local/bin/gcc -c -Wall -Wextra -pedantic -Wcast-align -Wattributes
61939.c
61939.c: In function ‘copy_something’:
61939.c:4:58: warning: initialization discards ‘const’ qualifier from pointer
target type [-Wdiscarded-qualifiers]
struct some_struct __attribute__((aligned(8))) *_s = s;
^
$
But beyond that, yeah, confirmed. I think there's probably a duplicate around
here somewhere but I've forgotten the number already...