From 0f52b11f911cd280f38c0a4ae79f6b952227881f Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 2 Jul 2019 12:31:57 -0300 Subject: [PATCH] prefcnt: Avoid ambiguous else with for_each macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses: [ 80%] Building C object CMakeFiles/prefcnt.dir/prefcnt.c.o /home/acme/git/pahole/prefcnt.c: In function ‘refcnt_tag’: /home/acme/git/pahole/prefcnt.c:67:5: error: suggest explicit braces to avoid ambiguous ‘else’ [-Werror=dangling-else] if (tag__is_struct(tag) || tag__is_union(tag)) ^ cc1: all warnings being treated as errors Signed-off-by: Arnaldo Carvalho de Melo --- prefcnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prefcnt.c b/prefcnt.c index 8b24db2..d8f14ee 100644 --- a/prefcnt.c +++ b/prefcnt.c @@ -64,9 +64,10 @@ static void refcnt_tag(struct tag *tag, const struct cu *cu) tag->visited = 1; - if (tag__is_struct(tag) || tag__is_union(tag)) + if (tag__is_struct(tag) || tag__is_union(tag)) { type__for_each_member(tag__type(tag), member) refcnt_member(member, cu); + } } static void refcnt_lexblock(const struct lexblock *lexblock, const struct cu *cu)