Re: [PATCH] comedi: Annotate struct comedi_lrange with __counted_by

From: Christophe JAILLET
Date: Sun Oct 01 2023 - 03:50:28 EST


Le 01/10/2023 à 09:25, Julia Lawall a écrit :

This is not found due to the regular expression used for the name of the
alloc function. Maybe you could drop it entirely? Maybe you could just
check for alloc somewhere in the string?

That's how I found it.
I simplified a lot Kees's script and looked for function names that did *not* match his regex.

Functions that:
- return a pointer to a struct
- are used with struct_size()
- store the value used to compite the size in another field of the struct

are good enough candidates.
I think that removing the regex all together would be just good enough.

CJ


identifier ALLOC =~ "alloc";

works in this case.

Also, I see in the link that you have:

// Options: --all-includes

You can actually force this by putting

#spatch --all-includes

Nice, thanks for the tip.


and any other options you want.

julia