From mboxrd@z Thu Jan 1 00:00:00 1970 From: mstefani@redhat.com (Michael Stefaniuc) Date: Mon, 22 Dec 2014 14:33:49 +0100 Subject: [Cocci] Change function invocations argument In-Reply-To: References: <254A1CAA-2FA6-4546-91BD-5E0C449C7F94@gmail.com> <2BD158D5-96AC-4BEC-81B9-F07A54C7BEEB@gmail.com> <5496B54D.8050501@users.sourceforge.net> <6C06025D-6720-4BBD-9D44-75802D8A5B53@gmail.com> Message-ID: <54981DBD.5000300@redhat.com> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr On 12/21/2014 03:01 PM, Julia Lawall wrote: > > > On Sun, 21 Dec 2014, Eliseo Mart?nez wrote: > >> That?s right. I wanted to remove external parentheses, which >> wasn?t done if employing only e2/e3. I hadn?t realized using >> (e2)/(e3) would take care of both cases (with/without >> parentheses), though. >> >> BTW, is there an easy way to remove **all** unneeded parentheses, >> project wide? > > Probably not. You could remove all parentheses, but that might > risk removing some needed ones. On the other hand, Coccinelle does > know something about precedednce, so you could try: > > -( e1 -) > > and see what happens. Probably it will do more than you expect, > though. Though it is easy to validate that the generated patch is truly a no-op. I use a sha1sum on the generated object files without and with the patch and compare those. Of course there is the danger that the code touched was ifdef'ed out so some developer discretion is still needed. bye michael