Hmm, you're right.  It seems to get quite confused with this slightly
unholy amalgamation of cpp in the same function:

=== snip ===
...
        switch (pfs->pfs_type) {
        case PFSmem: 
        case PFSregs: 
        case PFSfpregs:
#if defined(__HAVE_PROCFS_MACHDEP) && defined(PROCFS_MACHDEP_PROTECT_CASES)
        PROCFS_MACHDEP_PROTECT_CASES 
#endif
...
=== snip ===

(
where e.g.:

#define PROCFS_MACHDEP_PROTECT_CASES                                    \
        case Pmachdep_xmmregs:
)

Not sure how to best fix it, apart from flagging a more verbose error
for the user in the normal run.

But no rush, I managed to "workaround" the problem with manual editing ;)

cheers,
  antti

On Fri Jan 08 2010 at 15:15:56 +0100, Julia Lawall wrote:
> I am busy all day today, but perhaps the function has a parse error that 
> is causing it to be ignored?  Try running spatch -parse_c on your file.
> 
> julia
> 
> 
> On Fri, 8 Jan 2010, Antti Kantee wrote:
> 
> > hi,
> > 
> > I was doing a rototill with this very simple spatch:
> > 
> > === SNIP ===
> > @@
> > expression e;
> > @@
> > - VATTR_NULL(e)
> > + vattr_null(e)
> > === SNIP ===
> > 
> > However, it failed to match two places in the source tree.  Here's one:
> > 
> > http://nxr.netbsd.org/xref/src/sys/miscfs/procfs/procfs_vnops.c?r=1.176#675
> > 
> > pain-rustique:4:/sys/miscfs/procfs> spatch -sp_file ~/vattr.spatch -inplace 
> > procfs_vnops.c
> > init_defs_builtins: /usr/pkg/share/coccinelle/standard.h
> > HANDLING: procfs_vnops.c
> > pain-rustique:5:/sys/miscfs/procfs> grep VATTR_NULL procfs_vnops.c
> >         VATTR_NULL(vap);
> > 
> > It didn't look any different from all the other places where the spatch
> > worked fine.  Not converting that does result in a compilation failure,
> > so it is not a piece of stealthily masked comments.
> > 
> > What am I missing?
> > 
> > I'm using 0.1.8 on NetBSD (from pkgsrc), in case that matters.
> > 
> > thanks,
> >   antti
> > _______________________________________________
> > Cocci mailing list
> > [email protected]
> > http://lists.diku.dk/mailman/listinfo/cocci
> > (Web access from inside DIKUs LAN only)
> > 
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to