qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/6] qdict: Add convenience help


From: Julia Lawall
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/6] qdict: Add convenience helpers for wrapped puts
Date: Wed, 5 Apr 2017 10:38:37 +0200 (CEST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)


On Wed, 5 Apr 2017, Richard W.M. Jones wrote:

> On Wed, Apr 05, 2017 at 10:21:13AM +0200, Julia Lawall wrote:
> >
> >
> > On Wed, 5 Apr 2017, Richard W.M. Jones wrote:
> >
> > > On Tue, Apr 04, 2017 at 05:41:08PM -0500, Eric Blake wrote:
> > > > On 01/19/2017 08:38 AM, Eric Blake wrote:
> > > > > On 01/19/2017 03:25 AM, Markus Armbruster wrote:
> > > > >> Eric Blake <address@hidden> writes:
> > > > >>
> > > > >>> Quite a few users of qdict_put() were manually wrapping a
> > > > >>> non-QObject. We can make such call-sites shorter, by providing
> > > > >>> common macros to do the tedious work.  Also shorten nearby
> > > > >>> qdict_put_obj(,,QOBJECT()) sequences.
> > > > >>>
> > > > >>> Signed-off-by: Eric Blake <address@hidden>
> > > > >>> Reviewed-by: Alberto Garcia <address@hidden>
> > > > >>>
> > > > >>> ---
> > > > >>>
> > > > >>> v2: rebase to current master
> > > > >>>
> > > > >>> I'm okay if you want me to break this patch into smaller pieces.
> > > > >>
> > > > >> I guess I'm okay with a single piece, but I'd like to know how you 
> > > > >> did
> > > > >> the conversion.  Coccinelle?  Manually?
> > > > >
> > > > > Manual, via grepping for put_obj.*QOBJECT. I'll see if I can do the 
> > > > > same
> > > > > under Coccinelle (at which point, committing the script will make it
> > > > > easier to rerun cleanups if later code reintroduces poor usage
> > > > > patterns), so maybe I have a v3 coming up.
> > > >
> > > > I've got a Coccinelle patch (mostly) working now - but it has one
> > > > shortfall - I found places in tests/check-qdict.c that coccinelle
> > > > didn't, and traced it to the fact that our use of g_assert_cmpint(expr,
> > > > ==, expr) throws off the coccinelle parser so badly that it silently
> > > > ignores the entire function body containing the use of that macro.
> > >
> > > Julia ^ is this a known issue?
> >
> > Yes, it's completely standard.  If there is a problem parsing a top-level
> > code unit, then the whole top-level code unit is ignored.
>
> Actually I meant about g_assert_cmpint, but this is also good to
> know too.

OK, there is nothing special about g_assert_cmpint, but Coccinelle expects
expressions or types in function argument lists, so it gives a parse error
on finding an ==.

julia



reply via email to

[Prev in Thread] Current Thread [Next in Thread]