From cc3ef2754898659b72d8efade67c7137ba8f83aa Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 19 Feb 2015 13:22:44 +0300 Subject: [PATCH] type: add unions to type_to_str() Signed-off-by: Dan Carpenter --- smatch_type.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/smatch_type.c b/smatch_type.c index 04484df5..8c17b0eb 100644 --- a/smatch_type.c +++ b/smatch_type.c @@ -626,6 +626,11 @@ static int type_str_helper(char *buf, int size, struct symbol *type) return n + snprintf(buf + n, size - n, "*"); } else if (type->type == SYM_STRUCT) { return snprintf(buf, size, "struct %s", type->ident ? type->ident->name : ""); + } else if (type->type == SYM_UNION) { + if (type->ident) + return snprintf(buf, size, "union %s", type->ident->name); + else + return snprintf(buf, size, "anonymous union"); } else if (type->type == SYM_FN) { struct symbol *arg, *return_type, *arg_type; int i; -- 2.11.4.GIT