All of lore.kernel.org
 help / color / mirror / Atom feed
From: jglisse@redhat.com (Jerome Glisse)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Matching function pointer typedef
Date: Thu, 17 May 2018 15:48:52 -0400	[thread overview]
Message-ID: <20180517194851.GA15887@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1805172125150.2273@hadrien>

On Thu, May 17, 2018 at 09:28:00PM +0200, Julia Lawall wrote:
> 
> 
> On Tue, 15 May 2018, Jerome Glisse wrote:
> 
> > Hello,
> >
> > I am trying to modify an function pointer typedef something like:
> >
> > @@
> > @@
> > - typedef void (*toto_t)(int a, int b);
> > + typedef void (*toto_t)(int a, int b, int c);
> 
> This now works.  Currently, you need to remove the whole typedef and add
> it back, not just add the third argument as H?kon suggested.

Awesome ! :) Thank you for working on that.

> 
> >
> > But it seems spatch or the semantic does not handle function pointer.
> > Or simply that typedef is not well handled in the first place. Thing
> > like:
> >
> > @@
> > @@
> > - typedef int nombre;
> > + typedef unsigned nombre;
> 
> Was this just an experiment, or is it something you need?  I would imagine
> that the problem is that "unsigned" as a type by itself is not well
> supported.

This was just an experiment i did while trying to understand why my
function pointer typedef changes did not work. If i use long or any
basic ctype then it works.

Cheers,
J?r?me

  reply	other threads:[~2018-05-17 19:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 20:36 [Cocci] Matching function pointer typedef Jerome Glisse
2018-05-15 20:50 ` Håkon Løvdal
2018-05-15 20:53   ` Julia Lawall
2018-05-15 21:26     ` Jerome Glisse
2018-05-16 15:13       ` Jerome Glisse
2018-05-16 18:35         ` Julia Lawall
2018-05-17 19:28 ` Julia Lawall
2018-05-17 19:48   ` Jerome Glisse [this message]
     [not found]   ` <51d95102-78ad-b56b-c470-c83d3f6c6b9b@users.sourceforge.net>
2018-05-18 16:53     ` Julia Lawall
     [not found]       ` <c3c0b202-ad2c-b53e-f73c-acc2baba9279@users.sourceforge.net>
2018-05-18 17:54         ` Julia Lawall

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=20180517194851.GA15887@redhat.com \
    --to=jglisse@redhat.com \
    --cc=cocci@systeme.lip6.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 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.