Coccinelle archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Ali Raza <ali.raza@samsung.com>
Cc: "cocci@inria.fr" <cocci@inria.fr>
Subject: RE: [cocci] Function name change
Date: Sun, 2 Jun 2024 17:08:29 +0200 (CEST)	[thread overview]
Message-ID: <57329629-ffff-f375-775a-faad346ce79@inria.fr> (raw)
In-Reply-To: <48ecf4ec00c942bb841a356567d2aef1@samsung.com>

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

> >> I have the following.
>
> >> 
>
> >> MY_MACRO(foo(arg1, arg2,
>
> >>                                            arg3, arg4, arg5));
>
> >> 
>
> >> I want to change foo to bar, as follows.
>
> >> 
>
> >> MY_MACRO(bar(arg1, arg2,
>
> >>                                            arg3, arg4, arg5));
>
> > 
>
> >Try:
>
> > 
>
> >MY_MACRO(
>
> >- foo
>
> >+ bar
>
> >    (...))
>
> > 
>
> >If that doesn't work, then perhaps there is a problem in parsing your C
>
> >code.  Take a file that you expect to change and try
>
>  
>
> Here is the spatch you suggested.
>
>  
>
> 18:    MY_MACRO(
>
> 19:   - foo
>
> 20:   + bar
>
> 21:   (...))

There should be at least one space in front of the ( on line 21.

julia

>
>  
>
> And here is the output that I get.
>
> disjunction parenthesis in line 21 column 0 matched to normal parenthesis on
>  line 21
>
>  
>
> > 
>
> >  spatch --parse-c file.c
>
> > 
>
> >See if the code that you expect to change has bad or BAD in front of it.
>
>  
>
> Running spatch --parse-c file.c gives me 100.00% good or passed.
>
>  
>
> Thanks
>
> Ali
>
>  
>
> > 
>
> >julia
>
> > 
>
> > 
>
> >> 
>
> >> I have tried many versions of the following, but to no avail.
>
> >> 
>
> >> 
>
> >> @@
>
> >> expression E;
>
> >> @@
>
> >> <...
>
> >> -foo(E)
>
> >> +bar(E)
>
> >> ...>
>
> >> 
>
> >> 
>
> >> Thanks!
>
> >> 
>
> >> Ali
>
> >> 
>
>  
>
>

      parent reply	other threads:[~2024-06-02 15:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240602141758uscas1p292dac565d2e37b835caaccab029d456f@uscas1p2.samsung.com>
2024-06-02 14:17 ` [cocci] Function name change Ali Raza
2024-06-02 14:23   ` Julia Lawall
     [not found]     ` <48ecf4ec00c942bb841a356567d2aef1@samsung.com>
2024-06-02 15:08       ` Julia Lawall [this message]

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=57329629-ffff-f375-775a-faad346ce79@inria.fr \
    --to=julia.lawall@inria.fr \
    --cc=ali.raza@samsung.com \
    --cc=cocci@inria.fr \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).