From: julia.lawall@lip6.fr (Julia Lawall) Date: Thu, 12 May 2016 18:18:24 +0200 (CEST) Subject: [Cocci] remove redundant const qualifiers from function arguments In-Reply-To: <20160512161637.GN3766@xsjsorenbubuntu> References: <20160511031419.GY3766@xsjsorenbubuntu> <20160511055515.GA3766@xsjsorenbubuntu> <20160511060438.GB3766@xsjsorenbubuntu> <20160511184830.GG3766@xsjsorenbubuntu> <66c62c8e-43cd-dbab-7a0a-8d884362a141@users.sourceforge.net> <20160512055423.GH3766@xsjsorenbubuntu> <20160512161637.GN3766@xsjsorenbubuntu> Message-ID: To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr On Thu, 12 May 2016, S?ren Brinkmann wrote: > On Thu, 2016-05-12 at 09:06:45 +0200, Julia Lawall wrote: > > > > @removal@ > > > > identifier F, I; > > > > type T; > > > > @@ > > > > F(..., > > > > - const > > > > T I, > > > > ... > > > > ); > > > > Oops, now I see why this doesn't parse. When you make a rule for a > > prototype, you need to specify the return type (which could be just T1). > > Otherwise, the parser can't tell the difference between this and a > > function call. > > You're right that does it. Looks to me then that the grammar > documentation should not indicate the fn_ctype as optional for function > prototypes (http://coccinelle.lip6.fr/docs/main_grammar006.html)? Indeed. I'll fix that. Thanks! julia