[cocci] Reacting to negative source code search results with SmPL?
Markus Elfring <[email protected]>
| Newsgroups | fr.inria.cocci |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I constructed the following SmPL script variant for further development considerations.
@initialize:python@
@@
def my_notification1(id):
print(f"The call “{id}” was found.");
def my_notification2():
print("An undesirable function call was not found.");
@my_test_search1@
identifier action;
@@
action(123);
@script:python reporting1@
id << searching.action;
@@
my_notification1(id)
@my_test_search2@
id << searching.action;
@@
action(456);
@script:python reporting2 depends on ! my_test_search2@
@@
my_notification2()
Unfortunately, I am wondering about the following information.
Questionable test result (according to the software combination “Coccinelle 1.3.0”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> /usr/bin/spatch --parse-cocci test_not_finding_undesirable_function_call2.cocci
…
meta: parse error:
File "test_not_finding_undesirable_function_call2.cocci", line 20, column 0, charpos = 332
around = 'id',
whole content = id << my_test_search1.action;
The software documentation indicates that an exclamation mark (or not operator?)
should be usable for SmPL dependency specifications.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/e6f8731b851f5d76d2731a9d546dc4f0b181526e/docs/manual/cocci_syntax.tex#L81-103
Under which circumstances will such data processing become better supported?
Regards,
Markus