]> git.ipfire.org Git - thirdparty/gcc.git/commit
ubsan: Avoid -Wpadded warnings [PR94641]
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 Apr 2020 15:06:31 +0000 (17:06 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 16 Sep 2020 17:08:21 +0000 (19:08 +0200)
commit1e4a928134e8f17bbcae99f2bac2bbce73ef6f73
tree25b3799a2978f90527e4137d9d4ede7cc1994b14
parentdea597314f4503228e23e887ddbb773cbf197093
ubsan: Avoid -Wpadded warnings [PR94641]

-Wpadded warnings aren't really useful for the artificial types that GCC
lays out for ubsan.

2020-04-21  Jakub Jelinek  <jakub@redhat.com>

PR c/94641
* stor-layout.c (place_field, finalize_record_size): Don't emit
-Wpadded warning on TYPE_ARTIFICIAL rli->t.
* ubsan.c (ubsan_get_type_descriptor_type,
ubsan_get_source_location_type, ubsan_create_data): Set
TYPE_ARTIFICIAL.
* asan.c (asan_global_struct): Likewise.

* c-c++-common/ubsan/pr94641.c: New test.

(cherry picked from commit 73f8e9dca5ff891ed19001b213fd1f6ce31417e3)
gcc/asan.c
gcc/stor-layout.c
gcc/testsuite/c-c++-common/ubsan/pr94641.c [new file with mode: 0644]
gcc/ubsan.c