[Cocci] surprising SmPL result
Pierre Habouzit
pierre.habouzit at intersec.com
Thu Nov 26 23:29:16 CET 2009
On Thu, Nov 26, 2009 at 10:35:22PM +0100, Julia Lawall wrote:
> I agree that the generated diff file looks strange, but I wonder if it is
> just an artifact of diff? For the generated file, I get:
> > Surprisingly the result patch was:
> > --- mcms/backend.c 2009-11-26 09:55:50.273396942 +0100
> > +++ /tmp/cocci-output-16559-166c68-backend.c 2009-11-26 10:05:38.477901644 +0100
> > @@ -931,9 +931,9 @@ int be_campaign_cache_save(be_campaign_c
> >
> > qh_for_each_pos(status_line, lpos, &cp->status_line) {
> > sb_addf(cur_buf, "%d;", cp->status_line.keys[lpos]);
> > - qh_del_key(status_line, &cp->status_line, lpos);
> > qh_del_at(status_line, &cp->status_line, lpos); <----
> > - qh_del_at(status_line, &cp->status_line, 10);
> > + qh_del_at(status_line, &cp->status_line, lpos); <----
> > + qh_del_at_IS_BUGGY(status_line, &cp->status_line, 10);
> > }
oh right I totally missed that the two qh_del_at calls were identical
hence the diff is correct. Sorry for the noise.
I actually assumed that coccinelle was the tool generating the diff, so
I was expecting the exact -/+ pairs. But I'm silly, it's even written in
the diff header that coccinelle is just generating a new source file and
running diff on it. I should know better.
Sorry for the noise.
--
Intersec <http://www.intersec.com>
Pierre Habouzit <pierre.habouzit at intersec.com>
Tél : +33 (0)1 5570 3346
Mob : +33 (0)6 1636 8131
Fax : +33 (0)1 5570 3332
37 Rue Pierre Lhomme
92400 Courbevoie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.diku.dk/pipermail/cocci/attachments/20091126/7acf8591/attachment.pgp
More information about the Cocci
mailing list