Restricting SmPL disjunctions for identifier selections?

Markus Elfring <[email protected]>
Newsgroups gmane.linux.kernel.janitors,gmane.linux.kernel
Message-ID <[email protected]>
Hello,

Another tiny script variant for the semantic patch language can eventually help
to clarify special development ideas.


@my_test@
expression x;
@@
*x =
(kmalloc
|kstrdup
)(...)


Questionable test result (according to the software combination “Coccinelle 1.3.1”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> /usr/bin/spatch --parse-cocci test-disjunction.cocci
init_defs_builtins: /usr/lib64/coccinelle/standard.h
@my_test@
expression x;
@@


(
*x *= kmalloc(...)
|
*x *= kstrdup(...)
)


Grep query
kstrdup || kmalloc



Would you get into the mood to discuss further data processing possibilities?

A)
The originally specified SmPL disjunction is expanded by the Coccinelle software
so far.
It was indicated to perform a source code search for selected identifiers.
Would it be nicer to benefit any more from such a data restriction?

B)
The identifier selection was reversed for the construction of a grep command.
Can filter ordering matter any more for efficient text searches?
https://en.wikipedia.org/wiki/Short-circuit_evaluation


Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.