re PR c/51628 (__attribute__((packed)) is unsafe in some cases (i.e. add -Waddress-of-packed-member, etc.))
PR c/51628 PR target/88682 * c-c++-common/pr51628-10.c (unaligned_int128_t): Add may_alias attribute. From-SVN: r267970
This commit is contained in:
parent
ee8045e577
commit
e964d9b23a
|
@ -1,3 +1,10 @@
|
|||
2019-01-16 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c/51628
|
||||
PR target/88682
|
||||
* c-c++-common/pr51628-10.c (unaligned_int128_t): Add
|
||||
may_alias attribute.
|
||||
|
||||
2019-01-15 Nikhil Benesch <nikhil.benesch@gmail.com>
|
||||
|
||||
* gcc.misc-tests/godump-1.c: Add test case for typedef before
|
||||
|
|
|
@ -11,7 +11,7 @@ struct pair_t
|
|||
typedef struct unaligned_int128_t_
|
||||
{
|
||||
__int128_t value;
|
||||
} __attribute__((packed)) unaligned_int128_t;
|
||||
} __attribute__((packed, may_alias)) unaligned_int128_t;
|
||||
|
||||
struct pair_t p = {0, 1};
|
||||
unaligned_int128_t *addr = (unaligned_int128_t *) &p.i;
|
||||
|
|
Loading…
Reference in New Issue