coccigrep icon indicating copy to clipboard operation
coccigrep copied to clipboard

Strange mismatch

Open yhuelf opened this issue 12 years ago • 5 comments

I was working with the file "mp4.c" of VLC gitweb link

The following:

coccigrep -t demux_sys_t -a i_timescale -c -o set mp4.c

returns nothing, although line 476, you have this :

p_sys->i_timescale = p_mvhd->data.p_mvhd->i_timescale;

And even without the "-o set", this line isn't detected.

I've got latest coccigrep and coccinelle -1.0.0-rc9

This is strange because there is nothing unusual in the mismatched line...

yhuelf avatar Jan 19 '12 09:01 yhuelf

Actually it seems to be a bug in coccinelle, because using coccinelle directly with:

spatch -sp "e:demux_sys_t *:->i_timescale" mp4.c

I get a lot of matches, but not the one in question.

yhuelf avatar Jan 23 '12 10:01 yhuelf

Indeed a coccinelle bug:

http://comments.gmane.org/gmane.comp.version-control.coccinelle/2214

yhuelf avatar Jan 27 '12 17:01 yhuelf

Julia Lawall is great as usual!

regit avatar Jan 27 '12 17:01 regit

Indeed!

Now what would be great, in coccigrep, would to trigger a warning like:

WARNING: mp4.c lines 64 - 124 could not be parsed. You may run "spatch -type_c mp4.c" to have the details.

I can try to do a patch if you want, but I may need the help of Julia again, because I'm not sure that running:

spatch -type_c

and then parsing the output would be the most effecient way to do that...

yhuelf avatar Jan 28 '12 08:01 yhuelf

Hello,

If the warning occurs, we could at least have the user understand that there could have been some miss in the search. And that's an interesting information. Next step could be to fix it completely and use -type_c output but this is a second step.

regit avatar Mar 05 '12 09:03 regit