From 89b3cf0b87ec394fea7eb039fd02552890b701ea Mon Sep 17 00:00:00 2001 From: Udo Date: Sun, 9 Feb 2020 18:21:59 +0100 Subject: [PATCH] warn if attr. __cleanup__ is given in type decl. (Allow this as an extension?) --- tccgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tccgen.c b/tccgen.c index 06baf360..cb376fb1 100644 --- a/tccgen.c +++ b/tccgen.c @@ -4306,7 +4306,10 @@ do_decl: } skip('}'); parse_attribute(&ad); - struct_layout(type, &ad); + if ( ad.cleanup_func ) { + tcc_warning("attribute '__cleanup__' ignored on type"); + } + struct_layout(type, &ad); } } }