On Tue, 31 Jul 2018, Timur Tabi wrote:

> On Tue, Jul 31, 2018 at 9:33 AM, Julia Lawall <[email protected]> wrote:
>
> >> Coccinelle does a pretty good job at compating parameters into fewer
> >> lines, but it's not always aggressive enough.  Is there a tuning
> >> parameter I can try?
> >
> >     "--max-width", Arg.Set_int Flag_parsing_c.max_width,
> >     "  column limit for generated code";
>
> $ spatch --sp-file ~/sw/dev/gpu_drv/chips_a/nv_printf.cocci
> --max-width 80 --dir . > /tmp/n.patch
> /usr/lib/coccinelle/spatch: unknown option '--max-width'.
>
> $ spatch --version
> spatch version 1.0.4 with Python support and with PCRE support
>
> >> -        DBG_PRINTF((DBG_MODULE_OS, DEBUGLEVEL_TRACEINFO,
> >> -                    "NVGVI: %s(), Null state\n",
> >> -                    __FUNCTION__));
> >> +        NV_PRINTF(LEVEL_INFO, "%s(), Null state\n",
> >> +                  __FUNCTION__);
> >
> > In this case, I think it is just leaving __FUNCTION__ where it is.
>
> So what decides when it moves a parameter and when it doesn't?

I think that if a parameter is not in danger of overflowing and is not
modified it won't move.  It's not optimally formatting the argument list,
just avoiding going past the specified number of columns.

For example, some people may prefer one argument per line, while others
prefer to pack them as much as possible.  It doesn't try to figure out
this preference.

julia


>
> > Please always send a semantic patch and a .c file if you have a concern
> > about something, even if you have sent them before.  Then I can treat the
> > problems one by one, and don't have to search around in my mailbox for the
> > relevant information.
>
> Attached.
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to