diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-04-21 17:06:31 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-04-21 17:06:31 +0200 |
commit | 73f8e9dca5ff891ed19001b213fd1f6ce31417e3 (patch) | |
tree | 672bb597baac2acd957524d5f12db22395dbf327 /gcc/ubsan.c | |
parent | 08d6ec14e654292340ccc6aa5612bbd91d4d57e8 (diff) | |
download | gcc-73f8e9dca5ff891ed19001b213fd1f6ce31417e3.zip gcc-73f8e9dca5ff891ed19001b213fd1f6ce31417e3.tar.gz gcc-73f8e9dca5ff891ed19001b213fd1f6ce31417e3.tar.bz2 |
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.
Diffstat (limited to 'gcc/ubsan.c')
-rw-r--r-- | gcc/ubsan.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ubsan.c b/gcc/ubsan.c index da93831..acd8a0b 100644 --- a/gcc/ubsan.c +++ b/gcc/ubsan.c @@ -229,6 +229,7 @@ ubsan_get_type_descriptor_type (void) TYPE_FIELDS (ret) = fields[0]; TYPE_NAME (ret) = type_decl; TYPE_STUB_DECL (ret) = type_decl; + TYPE_ARTIFICIAL (ret) = 1; layout_type (ret); ubsan_type_descriptor_type = ret; return ret; @@ -277,6 +278,7 @@ ubsan_get_source_location_type (void) TYPE_FIELDS (ret) = fields[0]; TYPE_NAME (ret) = type_decl; TYPE_STUB_DECL (ret) = type_decl; + TYPE_ARTIFICIAL (ret) = 1; layout_type (ret); ubsan_source_location_type = ret; return ret; @@ -593,6 +595,7 @@ ubsan_create_data (const char *name, int loccnt, const location_t *ploc, ...) TYPE_FIELDS (ret) = fields[0]; TYPE_NAME (ret) = type_decl; TYPE_STUB_DECL (ret) = type_decl; + TYPE_ARTIFICIAL (ret) = 1; layout_type (ret); /* Now, fill in the type. */ |