> Then, would there be any way to match functions having the > literal “FUNC_ATTR_NONNULL_RET” in their declaration/definition?
A preprocessor symbol like "NULL" or "ZERO_OR_NULL_PTR" can be found at least. ;-) Would you like to try it out how many source code places can be found with your macro name? > @@ identifier func =~ "^(transstr|list_alloc|listitem_alloc| [...] > |concat_str)$"; [...] @@ > > var = func(...); > ... when != var = E > ( > * if (var == NULL) S; > | > * if (var != NULL) S; > ) Does this kind of SmPL disjunction make sense? > ``` > > As you see, I have to replicate the list. I would also appreciate if such repetition could be avoided for SmPL constraints. > Is there any better way to achieve the same effect? How do you think about to construct the desired regular expression by other programming scripts automatically? Would you like to store involved function names into specific data structures (like databases)? Regards, Markus _______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
