clang-format:格式化struct字段(如Linux内核)

时间:2016-06-24 22:54:35

标签: clang clang-format

是否可以格式化C结构字段(如在Linux内核中),以便所有变量NAME的字段与它们的TYPE对齐。相反,我得到的是仅由一个空格分隔的TYPE和NAME。

例如(预期):

struct napi_struct {
         struct list_head        poll_list;
         unsigned long           state;
         int                     weight;
         unsigned int            gro_count;
         int                     (*poll)(struct napi_struct *, int);
         struct net_device       *dev;
         struct sk_buff          *gro_list;
         struct sk_buff          *skb;
         struct hrtimer          timer;
         struct list_head        dev_list;
         struct hlist_node       napi_hash_node;
         unsigned int            napi_id;
};

要设置这些格式的clang格式参数是什么?

0 个答案:

没有答案