From 73f8e9dca5ff891ed19001b213fd1f6ce31417e3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 21 Apr 2020 17:06:31 +0200 Subject: 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 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. --- gcc/asan.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/asan.c') diff --git a/gcc/asan.c b/gcc/asan.c index cc8f912..ae14f7e 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -2661,6 +2661,7 @@ asan_global_struct (void) TYPE_FIELDS (ret) = fields[0]; TYPE_NAME (ret) = type_decl; TYPE_STUB_DECL (ret) = type_decl; + TYPE_ARTIFICIAL (ret) = 1; layout_type (ret); return ret; } -- cgit v1.1