Re: [cocci] Searching for function calls with known parameters (by SmPL)?
Markus Elfring <[email protected]> Thu, 26 Mar 2026 09:30:48 +0100
| Newsgroups | fr.inria.cocci |
|---|---|
| Message-ID | <[email protected]> |
>> Can function calls be restricted to known parameters accordingly? > > I still have no idea what you are asking about. I hope that communication difficulties can be adjusted also with help of further (software) users. > What is the connection > between a function call being placed at the beginning of a function and > the number of parameters that that function call requires? I hope also that another description approach can influence evolution in more desirable directions. Various functions were designed in the way that they handle parameters. https://cppreference.com/w/c/language/function_definition.html The Coccinelle software supports the metavariable type “parameter list” to some degree. https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/233b5ceb1d5a701fb270ebdf0a9bd6be0a6ce53b/docs/manual/cocci_syntax.tex#L233 Such lists support “special cases” accordingly. * They can be empty. Would you like to exclude this case occasionally? * More than one entry would be provided. The list length can become more interesting then. It can occasionally be nice that parameters would explicitly be restricted to a fixed number of items by the means of the semantic patch language. Data would be assigned to multiple parameters. But it is not directly known by this programming interface in which order they get passed to a function call. The passed data can be handled by the metavariable type “expression list”. There are some development challenges remaining for the mapping of contents with the mentioned metavariable types. Which expressions would refer to identifiers from a specified parameter list? Regards, Markus