Hello,

Le jeudi 12 juillet 2012 à 14:30 +0200, Julia Lawall a écrit :
> On Thu, 12 Jul 2012, Eric Leblond wrote:
> 
> > Hello,
> >
> > I'm currently running spatch (via coccigrep) on a code and I've got
> > matches in some conditional code:
> >
> > #ifdef UNITTESTS
> > ...
> > #endif
> >
> > I would like to be able to not do matches on this part of the code. Is
> > their an easy way to do so ?
> 
> No.  The matching process doesn't see the ifdefs.  There is a notion of
> skipping code that is under #if 0.  It could indeed be nice to generalize
> that to other constants.  Ideally, we would do partial evaluations as
> well, ie if we know that X is undefined, then perhaps X && Y is also
> undefined.  I can look into it.

That could be great. I'm sure it could help in a lot of situation for
example changing API for a single OS on a complex project.

BR,
-- 
Eric Leblond 
Blog: http://home.regit.org/ - Portfolio: http://regit.500px.com/

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to