[Cocci] Change function invocations argument

Eliseo Martínez eliseomarmol at gmail.com
Sun Dec 21 14:12:53 CET 2014


I’m afraid I still don’t get you.
What I’m asking is:

Given that coccinelle understands c structure, and knows about common isomorphisms, is there an easy way so that I can instruct it to analyze every expression in my source code, and remove parentheses at every place they’re not needed? By not needed, I mean that the c expression meaning (taking into account operator precedence and the like) is the same with and without parentheses.

I’m working with a 200000 LOC codebase. So, if there’s no dependable way to do this (without false positives and the like), then I’d have to manually review every change. Feasibility of that depends on how many instances are found, which I cannot now in advance. If they are too many and I have to review them manually, then this is probably not worth the trouble.

Regards, 
Eliseo.

> On 21 Dec 2014, at 13:55, SF Markus Elfring <elfring at users.sourceforge.net> wrote:
> 
>> Sorry, don’t understand your question…
> 
> I guess that you need to become more specific in your wording / programming
> about the source code places where parentheses are really unnecessary.
> 
> How many efforts would you like to invest to avoid false positives and other
> unwanted software changes?
> 
> Regards,
> Markus



More information about the Cocci mailing list