From mboxrd@z Thu Jan 1 00:00:00 1970 From: elfring@users.sourceforge.net (SF Markus Elfring) Date: Mon, 20 Jul 2015 15:27:21 +0200 Subject: [Cocci] Finding unstored return values with SmPL In-Reply-To: References: <55A62135.90206@users.sourceforge.net> <55AA3B1F.5020807@users.sourceforge.net> <55ACDC1C.1040005@users.sourceforge.net> Message-ID: <55ACF739.4020802@users.sourceforge.net> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr > In any case, what you want is > > identifier i; > > and then struct i structure_var = { ... .element = allocation(...) ... }; Thanks for your hint. @show_designated_initialisers@ field element; identifier allocation, structure_type, structure_var; @@ <+... *struct structure_type structure_var = { ... .element = allocation(...) ... }; ...+> elfring at Sonne:~/Projekte/Coccinelle/janitor> spatch.opt -sp-file show_designated_initialisers1.cocci unchecked_return_values1.c init_defs_builtins: /usr/local/lib/coccinelle/standard.h 155 156 Fatal error: exception Failure("minus: parse error: \n = File \"show_designated_initialisers1.cocci\", line 6, column 45, charpos = 155\n around = '.', whole content = *struct structure_type structure_var = { ... .element = allocation(...) ... };\n") How should my small SmPL example be improved further? http://en.cppreference.com/w/c/language/struct_initialization Regards, Markus