[Cocci] Finding function implementations that call only a single function.

SF Markus Elfring elfring at users.sourceforge.net
Fri Dec 5 15:20:50 CET 2014


>> How should function calls with a non-void return type be found currently?
> 
> Perhaps you can say
> 
> type t != void;

I have tried your suggestion out.


elfring at Sonne:~/Projekte/Coccinelle/Probe> spatch.opt -sp-file list_functions_with_single_function_call3.cocci /usr/src/linux-stable/drivers/gpu/drm/ast/ast_ttm.c
init_defs_builtins: /usr/local/share/coccinelle/standard.h
1847 1849
Fatal error: exception Failure("meta: parse error: 
 = File "list_functions_with_single_function_call3.cocci", line 82, column 17,  charpos = 1847
    around = '!=', whole content =      return_type != void;
")


But I do not like the shown error message again.


> If not, then match the void functions, save their position, and then match 
> the functions that are not in the same position.

I would appreciate if I do not need to fiddle more with SmPL position variables.

Regards,
Markus


More information about the Cocci mailing list