[Cocci] -o option fails when all files are skipped
christoph at burschka.de
Sat Feb 8 16:34:55 CET 2014
(Posted earlier at https://github.com/coccinelle/coccinelle/issues/16 )
Using the latest source (1.0.0-rc19), I'm trying to run this command:
spatch --no-includes --sp-file repr.cocci in.c -o out.c
This is the output I'm getting:
warning: line 9: should self be a metavariable?
warning: line 22: should self be a metavariable?
(ONCE) Expected tokens self PyObject PyString_FromString PyString_FromFormat
Fatal error: exception Failure("-o can not be applied because there are
multiple modified files")
Apparently this is because the only input file is skipped.
I was assuming that spatch would simply copy the unchanged input file in
that case, probably because I misinterpreted the following code block in
(match outfiles with
| [infile, Some outfile] when infile =$= x && null xs ->
Common.command2 ("cp " ^outfile^ " " ^ !output_file)
| [infile, None] when infile =$= x && null xs ->
Common.command2 ("cp " ^infile^ " " ^ !output_file)
| _ ->
(Instead, outfiles is an empty list. I guess it filters out the
irrelevant files before reaching this point? Sorry, I've never looked at
this source code before today.)
I'm trying to use this tool: https://fedorahosted.org/2to3c/
It applies a collection of semantic patches to a Python2 C extension to
upgrade it to Python3... but apparently it fails when any of those
patches are irrelevant. Is there a better way to do this?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 246 bytes
Desc: OpenPGP digital signature
More information about the Cocci