Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-11 Thread Julia Lawall
On Fri, 11 Oct 2019, Markus Elfring wrote: > > And what is the questionable source code place? > > I find implementation details occasionally questionable where checks for > variables > which provide a stored function return value are missing. > The possibility remains that also your search

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-11 Thread Markus Elfring
>> The possibility remains that also your search pattern suggestion will point >> update candidates out at other places than the implementation of the >> mentioned >> function “imx_pd_bind”. > > So many words. So little information. This can also occasionally happen if the search approach is

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-11 Thread Markus Elfring
>> @display@ >> expression x; >> identifier f; > > You can put f != {likely,unlikely} here. I would appreciate to achieve a better understanding how these likeliness annotations can influence the shown source code search approach. > Maybe there will be some false positives when x->f is in a

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-11 Thread Markus Elfring
>> @display@ >> expression x; >> identifier f; > > You can put f != {likely,unlikely} here. Now I have got a related impression. It seems that such a search pattern extension affects also our unfinished clarification for the desired handling of when constraints by SmPL ellipses. How will this

Re: [Cocci] macro parameters and expressions?

2019-10-11 Thread Julia Lawall
On Fri, 11 Oct 2019, Jürgen Groß wrote: > Hi, > > I have a simple semantic patch: > > virtual patch > > @@ > expression buf, val; > @@ > - snprintf(buf, PAGE_SIZE, "%d\n", val) > + spgprintf_d(buf, val) > > This works nearly always as expected, but not in some macros. The cases >

[Cocci] macro parameters and expressions?

2019-10-11 Thread Jürgen Groß
Hi, I have a simple semantic patch: virtual patch @@ expression buf, val; @@ - snprintf(buf, PAGE_SIZE, "%d\n", val) + spgprintf_d(buf, val) This works nearly always as expected, but not in some macros. The cases where it is not working are those when "val" is using a parameter of