Skip to contentSkip to conversation

Reacting to negative source code search results with SmPL?

cocci Markus Elfring 2 participants 5 messages Nov 12, 2025 – Nov 15, 2025

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 1 line

I constructed the following SmPL script variant for further development considerations.

Another SmPL script example:
@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 << my_test_search1.action;
@@
my_notification1(id)

@my_test_search2@
id << my_test_search1.action;
@@
action(456);

@script:python reporting2 depends on ! my_test_search2@ @@
my_notification2()

How will chances evolve for further software improvements?

Regards,
Markus

#2 lore raw
Quoted 1 line

How will chances evolve for further software improvements?

Corresponding development ideas might follow another SmPL script example.

@my_test_search1@
identifier action;
@@
action(123);

@script:python reporting1@
id << my_test_search1.action;
@@
print(f"The call “{id}” was found.")

@my_test_search2@
identifier my_test_search1.action;
@@
action(456);

@script:python reporting2 depends on ! my_test_search2@ @@
print("An undesirable function call was not found.")

Regards,
Markus

#3 lore raw
Quoted 3 lines · Markus Elfring
Quoted 1 line

How will chances evolve for further software improvements?

Corresponding development ideas might follow another SmPL script example.

I have no idea what this is supposed to be an example of.

julia

Quoted 24 lines

@my_test_search1@
identifier action;
@@
action(123);

@script:python reporting1@
id << my_test_search1.action;
@@
print(f"The call “{id}” was found.")

@my_test_search2@
identifier my_test_search1.action;
@@
action(456);

@script:python reporting2 depends on ! my_test_search2@ @@
print("An undesirable function call was not found.")

Regards,
Markus

#4 lore raw
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

How will chances evolve for further software improvements?

Corresponding development ideas might follow another SmPL script example.

I have no idea what this is supposed to be an example of.

Does such feedback indicate undesirable communication difficulties?

Otherwise:
* Search for function (or macro) calls

* Demonstration of an SmPL rule combination

* Usage of SmPL inheritance

* Application of SmPL dependency specifications

* Data transfer to Python code

Regards,
Markus