Re: [Cocci] [RFC PATCH] coccinelle: api: add flex_array_size.cocci script

2020-08-29 Thread Julia Lawall
On Sat, 29 Aug 2020, Markus Elfring wrote: > > Suggest flex_array_size() wrapper to compute the size of a > > flexible array member in a structure. The macro additionally > > checks for integer overflows. > > Can the following script variant for the semantic patch language help > to clarify

Re: [Cocci] [RFC PATCH] coccinelle: api: add flex_array_size.cocci script

2020-08-29 Thread Markus Elfring
> Suggest flex_array_size() wrapper to compute the size of a > flexible array member in a structure. The macro additionally > checks for integer overflows. Can the following script variant for the semantic patch language help to clarify any software development ideas and remaining open issues?

[Cocci] [RFC PATCH] coccinelle: api: add flex_array_size.cocci script

2020-08-28 Thread Denis Efremov
Suggest flex_array_size() wrapper to compute the size of a flexible array member in a structure. The macro additionally checks for integer overflows. The cocci script intentionally skips cases where count argument is not a member of a structure because this introduce false positives. Cc: Gustavo