Re: [RFC PATCH] coccinelle: check for integer overflow in binary search

From: Markus Elfring
Date: Thu Sep 05 2019 - 10:23:57 EST


> +@@
> +(
> + while (\(â\)) {
â
> + }

It seems that compound statements are mainly checked for
control flow statements by this source code search approach
so far.
Would you like to handle also single statements (without the
curly brackets)?
(Will additional SmPL disjunctions be needed then?)


> +statement S;
â
> +|
> + for (...; \(â\);
> + m = \(â\)) S

* Can the metavariable âSâ look nicer on a separate line?

* Should assignments be taken into account for more variables?


> +|
> + for (...; \(â\); ...) {
> + }
> +)

I find the shown case distinction incomplete.
Will loop initialisations trigger further SmPL development challenges?

Regards,
Markus