Thread (13 messages) flat view 13 messages, 4 authors, 2019-11-16

Re: [Cocci] git-coccinelle: adjustments for array.cocci?

From: Markus Elfring <hidden>
Date: 2019-11-16 06:57:45
Also in: cocci

quoted
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.

quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help