All of lore.kernel.org
 help / color / mirror / Atom feed
From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] question on parsing g_assert_cmpint() macro
Date: Wed, 5 Apr 2017 16:18:17 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1704051617480.3005@hadrien> (raw)
In-Reply-To: <093bdf57-0d50-8075-b0a1-6c4cbb9eda38@redhat.com>



On Wed, 5 Apr 2017, Eric Blake wrote:

> On 04/05/2017 12:25 AM, Julia Lawall wrote:
>
> >> What is the trick for teaching coccinelle about what g_assert_cmpint()
> >> expands to, and/or completely ignoring the use of that macro, so that I
> >> don't have to manually look for spots that the cleanup missed?
> >
> > Try adding
> >
> > #define g_assert_cmpint(x,y,z)
> >
> > to the macro definition file standard.h.  Or you can make your own macro
> > definition file for qemu and give it as an argument --macro-file file.h
> >
> > Write back if that does not solve the problem.
>
> Thanks. I didn't realize qemu already had a scripts/cocci-macro-file.h
> designed just for this purpose, and it includes
>
> #define g_assert_cmpint(a, op, b)   g_assert(a op b)

This definition looks fine too.

julia

>
> which indeed solves the problem.
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
>

      reply	other threads:[~2017-04-05 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 22:11 [Cocci] question on parsing g_assert_cmpint() macro Eric Blake
2017-04-05  5:25 ` Julia Lawall
2017-04-05 14:14   ` Eric Blake
2017-04-05 14:18     ` 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=alpine.DEB.2.20.1704051617480.3005@hadrien \
    --to=julia.lawall@lip6.fr \
    --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.