From a59459bb80e7d9480acdec5232b8a34817abf23a Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 19 Nov 2019 12:23:00 -0300 Subject: [PATCH] fprintf: Account inline type __aligned__ member types for spacing Fixing things like that anonymous union offset/size comment misalignment: union { refcount_t rcu_users; /* 2568 4 */ struct callback_head rcu __attribute__((__aligned__(8))); /* 2568 16 */ - } __attribute__((__aligned__(8))); /* 2568 16 */ + } __attribute__((__aligned__(8))); /* 2568 16 */ struct pipe_inode_info * splice_pipe; /* 2584 8 */ struct page_frag task_frag; /* 2592 16 */ struct task_delay_info * delays; /* 2608 8 */ Signed-off-by: Arnaldo Carvalho de Melo --- dwarves_fprintf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dwarves_fprintf.c b/dwarves_fprintf.c index d4ad79e..3794abf 100644 --- a/dwarves_fprintf.c +++ b/dwarves_fprintf.c @@ -859,6 +859,12 @@ static size_t class_member__fprintf(struct class_member *member, bool union_memb slen += packed_len; } + if (tag__type(type)->alignment != 0 && sizeof!conf->suppress_aligned_attribute) { + char bftmp[64]; + int aligned_len = snprintf(bftmp, sizeof(bftmp), " __attribute__((__aligned__(%u)))", tag__type(type)->alignment); + slen += aligned_len; + } + printed += fprintf(fp, sconf.hex_fmt ? "%*s/* %#5x" : "%*s/* %5u",