On Thu, 2020-09-03 at 17:14 +0200, Julia Lawall wrote:
> On Wed, 2 Sep 2020, Joe Perches wrote:
> > On Wed, 2020-09-02 at 22:46 +0200, Julia Lawall wrote:
> > > On Wed, 2 Sep 2020, Joe Perches wrote:
> > > > On Sun, 2020-08-30 at 20:41 +0200, Julia Lawall wrote:
> > > > > On Sun, 30 Aug 2020, Joe Perches wrote:
> > > > > > On Sun, 2020-08-30 at 17:46 +0200, Julia Lawall wrote:
> > > > > > > Unfortunately this does not work when the declaration
> > > > > > is comma terminated and not semicolon terminated.
> > > > []
> > > > > I will have to look into it.  It should handle this sort of thing, 
> > > > > but it
> > > > > is somewhat complex, because the declarations have to be split and 
> > > > > this
> > > > > specific case may not be handled.
> > > > 
> > > > Thanks.  Hope you can get to look at that one day.
> 
> It works if you replace the addition of the new declaration by ++.  It
> seems that it is concerned that if there are multiple variables in the
> original declaration then it may be necessary to do multiple additions and
> so it doesn't do anything for a single +.  You can see this information
> with the --debug option.

Thanks, works now.

> The newlines in the generated code are also not what one would hope for.
> I will see if this can be improved.

One day.

It's not urgent for me as all the proposed changes
would need to be checked manually and the rename can
cause other alignment issues around not just the
definition changes but in code too.

e.g.:
        written = sysfs_emit(buf,
                             "foo", bar...);
becomes
        len = sysfs_emit(buf,
                             "foo", bar...);

I have other scripts that can fix both the definition
and the alignment changes done by coccinelle.

cheers, Joe

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to