Searching for C++ delete expressions (with SmPL)?
Hello,
Another SmPL script example:
#spatch --c++
@display@
expression e;
@@
delete
?[]
*e
Questionable test result (by the software combination “Coccinelle 1.3.0” for example):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> /usr/bin/spatch --parse-cocci show_delete_expressions.cocci …
warning: incompatible arity found on line 5
…
delete [] *e
…
How will clarification interests evolve further for this issue?
Regards,
Markus
Quoted 21 lines · Markus Elfring
Hello,
Another SmPL script example:
#spatch --c++
@display@
expression e;
@@
delete
?[]
*eQuestionable test result (by the software combination “Coccinelle 1.3.0” for example):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor>/usr/bin/spatch--parse-coccishow_delete_expressions.cocci…
warning: incompatible arity found on line 5
…
delete [] *e
…
Quoted 1 line
How will clarification interests evolve further for this issue?
In general, I don't think you can put ? on random subterms. You could do what you want with a disjunction.
julia
Quoted 10 lines
Quoted 10 lines
Another SmPL script example:
#spatch --c++
@display@
expression e;
@@
delete
?[]
*e
Quoted 5 lines
Quoted 5 lines
Questionable test result (by the software combination “Coccinelle 1.3.0” for example):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor>/usr/bin/spatch--parse-coccishow_delete_expressions.cocci…
warning: incompatible arity found on line 5
…
…> In general, I don't think you can put ? on random subterms.
How will the support evolve further for key word variants of the programming language “C++”?
Quoted 2 lines
You could do
what you want with a disjunction.
Under which circumstances will the mentioned “warning” be reconsidered better?
Regards,
Markus
Quoted 17 lines · Markus Elfring
Quoted 10 lines
Quoted 10 lines
Another SmPL script example:
#spatch --c++
@display@
expression e;
@@
delete
?[]
*eQuoted 5 lines
Quoted 5 lines
Questionable test result (by the software combination “Coccinelle 1.3.0” for example):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor>/usr/bin/spatch--parse-coccishow_delete_expressions.cocci…
warning: incompatible arity found on line 5
……> In general, I don't think you can put ? on random subterms.
Quoted 7 lines
How will the support evolve further for key word variants of the programming language “C++”?
Quoted 2 lines
You could do
what you want with a disjunction.Under which circumstances will the mentioned “warning” be reconsidered better?
None.
Quoted 3 lines
Quoted 1 line
Under which circumstances will the mentioned “warning” be reconsidered better?
None.
I hope that additional development resources will influence software evolution in more desirable directions.
Regards,
Markus
Quoted 2 lines
In general, I don't think you can put ? on random subterms. You could do what you want with a disjunction.
Will another SmPL script example trigger further collateral evolution?
#spatch --c++
@display@
expression e;
@@
(delete[]
*e
|delete
*e
)
Regards,
Markus
Quoted 1 line
Will another SmPL script example trigger further collateral evolution?
Would you be looking for SmPL script variations which can handle known C++ source code transformation patterns to some degree?
* https://clang.llvm.org/extra/clang-tidy/checks/readability/delete-null-pointer.html
Regards,
Markus