All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: thomas pedersen <thomas@ibsgaard.io>
Cc: cocci@systeme.lip6.fr
Subject: Re: [Cocci] SmPL patch against C macro
Date: Tue, 19 Feb 2019 07:55:59 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1902190755130.2570@hadrien> (raw)
In-Reply-To: <CABWD38=R3aZDpEvRTc-aidKuQ9QT1BhfN+h7Zo_PLu2SgvdBmw@mail.gmail.com>



On Mon, 18 Feb 2019, thomas pedersen wrote:

> Hello,
>
> I'm trying to write an SmPL patch which will modify C macro. The test files are:
>
> # test_macro.c
> #define MYMACRO(adsf) { \
>         .foo = (asdf),\
> }
>
> # test_macro.cocci
> @@
> expression E;
> @@
>
> {
> .foo = E
> + * 1000
> }
>
> Running with:
> $ spatch --debug --sp-file test_macro.cocci test_macro.c
>
> Gives the output:
> Unsupported form of #define: File "test_macro.c", line 1
>
> What's the correct syntax to match against a similar macro?

It was the macro definition itself that was not supported.  The problem
should be fixed now.  You can get the latest version from Github.

julia

>
> Thanks,
> Thomas
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

  reply	other threads:[~2019-02-19  6:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19  2:01 [Cocci] SmPL patch against C macro thomas pedersen
2019-02-19  6:55 ` Julia Lawall [this message]
2019-02-20  6:25   ` thomas pedersen

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.1902190755130.2570@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=thomas@ibsgaard.io \
    /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 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.