cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Jerome Glisse <jglisse@redhat.com>
Cc: cocci@systeme.lip6.fr
Subject: Re: [Cocci] Adding a field to struct and new line issues
Date: Sat, 12 Jan 2019 07:14:29 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1901120714041.2837@hadrien> (raw)
In-Reply-To: <20190111222417.GE3190@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]



On Fri, 11 Jan 2019, Jerome Glisse wrote:

> Hi,
>
> I am trying to add a field to struct however coccinelle insist on
> adding it on the same line as struct name definition ie:
>
> spatch:
> @@
> @@
> struct foo {
> +int roto;
> ...
> }
>
> original c code:
> struct foo {
>     int titi;
> };
>
> result:
> struct foo {int roto;
>     int titi;
> };
>
>
> This is kind of ugly and i am at loss trying to force a new line ie:
> struct foo {
>     int roto;
>     int titi;
> };
>
>
>
> Funny thing, trying to out smart coccinelle with:
> @@
> identifier I1;
> type T1;
> @@
> struct foo {
> T1 I1;
> +int roto;
> ...
> }
>
> Gives:
> struct foo {
>     int titi;int roto;
> };
>
>
> I am still scratching my head on how i can force a new line. There
> does not seem to have \n or any escape sequence i can use to force
> new line.

Sorry, it seems to be a pretty printing problem.  I will fix it.

julia

>
> Thank you for any pointers toward that.
> Jérôme
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

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

  reply	other threads:[~2019-01-12  6:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 22:24 [Cocci] Adding a field to struct and new line issues Jerome Glisse
2019-01-12  6:14 ` Julia Lawall [this message]
2019-01-12 16:45 ` Julia Lawall
2019-01-12 17:51   ` Jerome Glisse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1901120714041.2837@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=jglisse@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).