Re: [Cocci] git-coccinelle: adjustments for array.cocci?
- From
- Markus Elfring <markus.elfring@web.de>
- Date
- Nov 16, 2019, 06:57 UTC
- Message-ID
- <4ee4604e-0eb1-d4a6-24bb-52abe0db3f53@web.de>
- In-Reply-To
- <alpine.DEB.2.21.1911152000170.8961@hadrien>
Show 8 quoted lines
>> https://github.com/git/git/blob/3edfcc65fdfc708c1c8f1d314885eecf9beb9b67/fast-import.c#L640 >> >> I got the impression that the Coccinelle software is occasionally able >> to determine from the search specification “sizeof(T)” the corresponding >> data type for code like “*(t->entries)”. > > It can determine the type of t->entries if it has access to the definition > of the type of t.
Should this type determination always work here because the data structure “tree_content” for the parameter “t” of the function “grow_tree_content” is defined in the same source file? https://github.com/git/git/blob/3edfcc65fdfc708c1c8f1d314885eecf9beb9b67/fast-import.c#L85
> This type may be in a header file. If you want > Coccinelle to be able to find this information you can use the option > --all-includes or --recursive-includes. It will be more efficient with > the option --include-headers-for-types.
Such information can be more helpful in other situations than the mentioned test case.
>> But it seems that there are circumstances to consider where the desired >> data type was not automatically determined.
Would you like to take the presented differences from the discussed before/after comparison better into account?
Regards, Markus