Thanks,
I think adding the option --no_includes and
spatching each file one by one would be my solution.
------------------------------------------
From: Julia Lawall
Sent: Tuesday, June 19, 2012 3:25 PM
To: yafo lee
Cc: [email protected]
Subject: Re: [Cocci] How to save multiple modified files
On Tue, 19 Jun 2012, yafo lee wrote:
Hi guys, when I try to spatch a file with the -o option,
I got error:
Fatal error: exception Failure("-o can not be applied because there are
multiple modified files")
But when I run it again without -o option, it seams no file has been
changed.
What should I do with these?
Thanks.
# spatch --sp-file bsd_ifp.cocci dst/alc_hw.h -o dst/alc_hw.h
init_defs_builtins: /usr/local/share/coccinelle/standard.h
HANDLING: dst/alc_hw.h
Fatal error: exception Failure("-o can not be applied because there are
multiple modified files")
# spatch --sp-file bsd_ifp.cocci dst/alc_hw.h
init_defs_builtins: /usr/local/share/coccinelle/standard.h
HANDLING: dst/alc_hw.h
#
On a random example, I can't reproduce the problem. Coccinelle makes a
small effort not to print a patch when nothing significant has changed, eg
only whitespace. So it is possible that that is what occurs here.
You could try adding the option -no_includes, if no information from
header files is needed. In that case, you are sure that included header
files will not be transformed.
If you have the Coccinelle source code, you could try modifying the end of
the function generate_outfiles in the file main.ml to print out more
information. For example, you could add
Printf.printf "outfiles %s\n" (Dumper.dump outfiles);
The result will not be super readable, but you will see what files are
being modifier.
There can actually only be one modified file, but if it is a file other
than the one given on the command line, then you will still get the error
message.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)