Determination of static data types by SmPL constraints?
Hello,
I am using the following bit of code for semantic patch language scripts.
?
@find_static depends on safety_check@
identifier safety_check.work;
position safety_check.pos;
@@
static void work at pos(...)
{
...
}
?
The Coccinelle software was extended for the handling of special constraints by the execution of embedded scripts in supported programming languages to some degree.
I got the idea that this functionality could also be used now to check the usage of a storage-class specifier like ?static? in data types for further source code analysis approaches.
* How should such a specifier be determined by the programming interfaces of ?Coccilib??
* Would you like to compare run time characteristics for the execution of the shown SmPL rule and a similar constraint implemented as an OCaml (or Python) script?
Regards,
Markus
Quoted 23 lines · SF Markus Elfring
Hello,
I am using the following bit of code for semantic patch language scripts.
?
@find_static depends on safety_check@
identifier safety_check.work;
position safety_check.pos;
@@
static void work at pos(...)
{
...
}
?The Coccinelle software was extended for the handling of special constraints by the execution of embedded scripts in supported programming languages to some degree.
I got the idea that this functionality could also be used now to check the usage of a storage-class specifier like ?static? in data types for further source code analysis approaches.
Quoted 6 lines
* How should such a specifier be determined by the programming interfaces of ?Coccilib??
* Would you like to compare run time characteristics for the execution of the shown SmPL rule and a similar constraint implemented as an OCaml (or Python) script?
I have no idea what you are talking about.
What is wrong with the rule that is shown?
julia
[Cocci] non-static data structure selection by SmPL
Quoted 1 line
I have no idea what you are talking about.
I got the impression that recent extensions for the Coccinelle software could increase the chances to update the support for special constraints a bit more.
Quoted 1 line
What is wrong with the rule that is shown?
This SmPL specification is still working for a while.
I became curious once more if there are further possibilities to select in a single SmPL rule if a storage-class specifier like ?static? was not (!) specified. How do you think about to reduce the dependency on position variables (or internal database tables) for such source code checking?
Regards,
Markus
[Cocci] non-static data structure selection by SmPL
Quoted 6 lines · SF Markus Elfring
Quoted 1 line
I have no idea what you are talking about.
I got the impression that recent extensions for the Coccinelle software could increase the chances to update the support for special constraints a bit more.
Quoted 8 lines
Quoted 1 line
What is wrong with the rule that is shown?
This SmPL specification is still working for a while.
I became curious once more if there are further possibilities to select in a single SmPL rule if a storage-class specifier like ?static? was not (!) specified. How do you think about to reduce the dependency on position variables (or internal database tables) for such source code checking?
disable optional_storage
It has probably existed for the last 10 years.
julia
[Cocci] non-static data structure selection by SmPL
Quoted 1 line
disable
optional_storage
Thanks for your hint.
* How do you think about to expose more information around this special setting for the handling of ?annotations? by the semantic patch language together with ?Coccilib??
* Would it make sense to specify any SmPL constraints for storage-class specifiers?
Regards,
Markus