From: soren.brinkmann@xilinx.com (=?utf-8?B?U8O2cmVu?= Brinkmann) Date: Thu, 12 May 2016 09:16:37 -0700 Subject: [Cocci] remove redundant const qualifiers from function arguments In-Reply-To: References: <20160511031419.GY3766@xsjsorenbubuntu> <20160511055515.GA3766@xsjsorenbubuntu> <20160511060438.GB3766@xsjsorenbubuntu> <20160511184830.GG3766@xsjsorenbubuntu> <66c62c8e-43cd-dbab-7a0a-8d884362a141@users.sourceforge.net> <20160512055423.GH3766@xsjsorenbubuntu> Message-ID: <20160512161637.GN3766@xsjsorenbubuntu> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr 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)? Thanks, S?ren