All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] some questions related to output formatting
@ 2017-01-26 13:45 Kumar Gala
  2017-01-26 14:18 ` Julia Lawall
  0 siblings, 1 reply; 6+ messages in thread
From: Kumar Gala @ 2017-01-26 13:45 UTC (permalink / raw)
  To: cocci

1. Is there a way to adjust the 80 char line break limit?
2. When I?m using a python script that parses a token that crosses multiple lines for some reason the output gets merged onto a single line:

-                       printk(" Min latency from hw interrupt up to 'C' int. "
-                              "handler:"
-                              " %d tcs = %d nsec\n",
+                       printk(" Min latency from hw interrupt up to 'C' int. " "handler:" " %lu tcs = %lu nsec\n?,

Is there something I should be doing special?

I?m using a modified version of Johann?s script for adjusting printf formatters:

https://systeme.lip6.fr/pipermail/cocci/2016-August/003533.html

Thanks

- k

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] some questions related to output formatting
  2017-01-26 13:45 [Cocci] some questions related to output formatting Kumar Gala
@ 2017-01-26 14:18 ` Julia Lawall
  2017-01-26 14:29   ` Kumar Gala
  0 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2017-01-26 14:18 UTC (permalink / raw)
  To: cocci



On Thu, 26 Jan 2017, Kumar Gala wrote:

> 1. Is there a way to adjust the 80 char line break limit?

Currently, it's a non-modifiable configuration variable.  I can add a flag
for it.

> 2. When I?m using a python script that parses a token that crosses multiple lines for some reason the output gets merged onto a single line:
>
> -                       printk(" Min latency from hw interrupt up to 'C' int. "
> -                              "handler:"
> -                              " %d tcs = %d nsec\n",
> +                       printk(" Min latency from hw interrupt up to 'C' int. " "handler:" " %lu tcs = %lu nsec\n?,
>
> Is there something I should be doing special?

I think that it would be difficult to do anything about this.  The string
passes through python and gets modified, and then gets dumped back into
the code in the end.  At that point, Coccinelle just sees it as one atomic
unit.  Does the issue come up a lot?

julia

> I?m using a modified version of Johann?s script for adjusting printf formatters:
>
> https://systeme.lip6.fr/pipermail/cocci/2016-August/003533.html
>
> Thanks
>
> - k
>
>
> _______________________________________________
> Cocci mailing list
> Cocci at systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] some questions related to output formatting
  2017-01-26 14:18 ` Julia Lawall
@ 2017-01-26 14:29   ` Kumar Gala
  2017-01-26 15:31     ` Julia Lawall
  2017-01-26 15:37     ` Julia Lawall
  0 siblings, 2 replies; 6+ messages in thread
From: Kumar Gala @ 2017-01-26 14:29 UTC (permalink / raw)
  To: cocci


> On Jan 26, 2017, at 8:18 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> 
> 
> 
> On Thu, 26 Jan 2017, Kumar Gala wrote:
> 
>> 1. Is there a way to adjust the 80 char line break limit?
> 
> Currently, it's a non-modifiable configuration variable.  I can add a flag
> for it.

That would be useful.

>> 2. When I?m using a python script that parses a token that crosses multiple lines for some reason the output gets merged onto a single line:
>> 
>> -                       printk(" Min latency from hw interrupt up to 'C' int. "
>> -                              "handler:"
>> -                              " %d tcs = %d nsec\n",
>> +                       printk(" Min latency from hw interrupt up to 'C' int. " "handler:" " %lu tcs = %lu nsec\n?,
>> 
>> Is there something I should be doing special?
> 
> I think that it would be difficult to do anything about this.  The string
> passes through python and gets modified, and then gets dumped back into
> the code in the end.  At that point, Coccinelle just sees it as one atomic
> unit.  Does the issue come up a lot?

A fair amount for the code base I?m working on (Zephyr - https://www.zephyrproject.org).  What?s interesting is this seems to bypass the line length check/breaking.

- kumar

> 
> julia
> 
>> I?m using a modified version of Johann?s script for adjusting printf formatters:
>> 
>> https://systeme.lip6.fr/pipermail/cocci/2016-August/003533.html
>> 
>> Thanks
>> 
>> - k
>> 
>> 
>> _______________________________________________
>> Cocci mailing list
>> Cocci at systeme.lip6.fr
>> https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] some questions related to output formatting
  2017-01-26 14:29   ` Kumar Gala
@ 2017-01-26 15:31     ` Julia Lawall
  2017-01-26 15:37     ` Julia Lawall
  1 sibling, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2017-01-26 15:31 UTC (permalink / raw)
  To: cocci

For parsing Zephyr, the main issue seems to be the __IO annotation.  You
can take the existing standard.h, copy it to eg zephyr.h and add

#define __IO

then when you run Coccinelle, put --macro-file-builtins zephyr.h

You should also be able to put at the root of the zephyr directory a file
.cocciconfig

[spatch]
options = --macro-file-builtins zephyr.h

Or rather the complete path for zephyr.h.  Then this file will always be
used when you run Coccinelle on code in the zephyr directory.

julia

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] some questions related to output formatting
  2017-01-26 14:29   ` Kumar Gala
  2017-01-26 15:31     ` Julia Lawall
@ 2017-01-26 15:37     ` Julia Lawall
  2017-01-31 10:13       ` Michael Stefaniuc
  1 sibling, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2017-01-26 15:37 UTC (permalink / raw)
  To: cocci



On Thu, 26 Jan 2017, Kumar Gala wrote:

>
> > On Jan 26, 2017, at 8:18 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> >
> > On Thu, 26 Jan 2017, Kumar Gala wrote:
> >
> >> 1. Is there a way to adjust the 80 char line break limit?
> >
> > Currently, it's a non-modifiable configuration variable.  I can add a flag
> > for it.
>
> That would be useful.

You can pull this from github.  --max-width n

julia

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cocci] some questions related to output formatting
  2017-01-26 15:37     ` Julia Lawall
@ 2017-01-31 10:13       ` Michael Stefaniuc
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Stefaniuc @ 2017-01-31 10:13 UTC (permalink / raw)
  To: cocci

On 01/26/2017 04:37 PM, Julia Lawall wrote:
> 
> 
> On Thu, 26 Jan 2017, Kumar Gala wrote:
> 
>>
>>> On Jan 26, 2017, at 8:18 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>>>
>>>
>>>
>>> On Thu, 26 Jan 2017, Kumar Gala wrote:
>>>
>>>> 1. Is there a way to adjust the 80 char line break limit?
>>>
>>> Currently, it's a non-modifiable configuration variable.  I can add a flag
>>> for it.
>>
>> That would be useful.
> 
> You can pull this from github.  --max-width n
Thanks Julia!
This is helpful for my Wine work where the preferred line length is 100.
I just kept forgetting to ask for it.

bye
	michael

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-31 10:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 13:45 [Cocci] some questions related to output formatting Kumar Gala
2017-01-26 14:18 ` Julia Lawall
2017-01-26 14:29   ` Kumar Gala
2017-01-26 15:31     ` Julia Lawall
2017-01-26 15:37     ` Julia Lawall
2017-01-31 10:13       ` Michael Stefaniuc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.