>> I am looking for ways to avoid source code duplication by inclusion of
>> other files.
>> Would it make sense to allow the use of an include statement within the
>> SmPL variable definition block of a rule?
> I have the impression that what you want would be adequately implemented
> by a virtual identifier that could be tested in the code or by a virtual rule.

These syntax elements will fit also to some use cases.


> For example, the semantic patches in the Linux kernel provide alternate
> implementations depending on whether one uses the arguments -D patch, -D 
> context, etc.

These parameters have got an influence on rule dependencies.

I am thinking about an other use case a bit more where I have got a few
SmPL script templates which are working to some degree. If I would like
to use also the functionality “Script constraints on meta-variables”
(instead of a big regular expression) for a function name selection on
demand there, I am going to recombine existing pieces by a corresponding
make script as a kind of preprocessing step.

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to