Messages in this thread |  | | Date | Tue, 7 Jan 2020 18:25:07 +0100 (CET) | From | Julia Lawall <> | Subject | Re: [PATCH v2] coccinelle: semantic patch to check for inappropriate do_div() calls |
| |
> +@depends on context@ > +expression f; > +long l; > +unsigned long ul; > +u64 ul64; > +s64 sl64; > + > +@@ > +( > +* do_div(f, l); > +| > +* do_div(f, ul); > +| > +* do_div(f, ul64); > +| > +* do_div(f, sl64); > +)
This part is not really ideal. For the reports, you filter for the constants, but here you don't do anything. You can put some python code in the matching of the metavariables:
unsigned long ul : script:python() { whatever you want to check on ul };
Then it will only match if the condition is satisfied.
julia
|  |