On Mon, Apr 29, 2019 at 12:26:49PM -0400, Julia Lawall wrote: > > > On Mon, 29 Apr 2019, Nicholas Mc Guire wrote: > > > > > Hi ! > > > > I'm trying to detect false positive sparse messages by taking > > the pattern and scanning with coccinelle for it so that the > > fix could be generated. Basically the identification seems > > to be working (a type-check on var is stil missing - but thats > > a different issue) - the problem though is that I'm unable > > to insert the (__force __be16) cast in the patch rule as > > coccinelle is refusing hose lines. Any hint how that could be > > done or is the problem the syntactic oddity of having a > > unknown keyworkd followed by a type that is confusing coccinelle > > here ? > > Types like this are currently not parsed properly - see the GSoC project. > I'm not sure that there is a good solution at the moment. This should be > parsed OK by the C parser, so you could try passing through python. See > python_mdecl.cocci. It may be necessary to construct the complete > expression (__force __be16)var in python. > ok - so I guess this means the issue applies to all type attributes then. Using python might be doable but the goal is to not grow the number of involved tools - there are already too many anyway. I'll try poking around in coccinelle then - not sure how hard that would be to add that - something like an typedef equivalent called attributedef would be my first guess.
thx! hofrat _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci