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 <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2019-11-19 12:23:00 -03:00
parent 56547f133a
commit a59459bb80
1 changed files with 6 additions and 0 deletions

View File

@ -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",