1. The problem is that the scripts in the linux kernel are highly configurable. They can give output in different forms, as controlled by various command line arguments. So they should be used via the kernel make system, which adds the proper arguments. You can look at the virtual declarations at the top of the file to see what the possible arguments are. For example, for some of the rules, you can add the command line argument -D patch, to get a patch with the bug fixed. Other options are -D report (a bug report in text form), -D org (a bug report in emacs org mode notation), and -D context (a diff, in which the - lines indicate code relevant to the bug).
2. Strange about the compilation problem. Try make depend. julia On Thu, 8 Sep 2011, Daniel Borkmann wrote: > Hi all, > > I bravely take the risk that this might be newbie questions ... > however, I'll ask anyway. ;-) > > I've built the latest 1.0.0-rc7 release on an Ubuntu Maverick Meerkat > machine (3.0.0-rc1+ #3 SMP, x86_64 GNU/Linux). After installing a few > dependencies form the Ubuntu repository, the built went fine. I > intended to check my kernel module against some scripts that can be > found in the kernel source (i.e., > http://lingrok.org/source/xref/linux-2.6-linus/scripts/coccinelle/). > However, I guess that the latest spatch cannot parse them (or I did > something wrong): > > $ spatch -version > spatch version 1.0.0-rc7 with Python support and with PCRE support > $ spatch -local_includes -out_place -sp_file > api/alloc/kzalloc-simple.cocci <file.c> > init_defs_builtins: /usr//share/coccinelle/standard.h > Fatal error: exception Failure("False should not be in the final > result. Perhaps your rule doesn't contain any +/-/* code") > > If I try the same with the version of the Ubuntu repository, it works > for _some_ scripts that are part of the kernel source tree. > > $ spatch -version > spatch version 0.2.2 with Python support > > On some of them, I get an errors like this (I assume, that this might > be due to newer language features?): > > init_defs_builtins: /usr/share/coccinelle/standard.h > 809 811 > Fatal error: exception Failure("meta: parse error: > = File "locks/double_lock.cocci", line 44, column 13, charpos = 809 > around = '<=', whole content = expression x <= locked.E1; > ") > > init_defs_builtins: /usr/share/coccinelle/standard.h > 805 807 > Fatal error: exception Failure("meta: parse error: > = File "locks/flags.cocci", line 43, column 13, charpos = 805 > around = '<=', whole content = expression f <= r.flags; > ") > > init_defs_builtins: /usr/share/coccinelle/standard.h > 1040 1042 > Fatal error: exception Failure("meta: parse error: > = File "null/deref_null.cocci", line 52, column 16, charpos = 1040 > around = '<=', whole content = expression subE <= ifm.E; > ") > > init_defs_builtins: /usr/share/coccinelle/standard.h > 1140 1141 > Fatal error: exception Failure("meta: semantic error: position cannot > be inherited over modifications: p > =File "null/kmerr.cocci", line 46, column 25, charpos = 1140 > around = ';', whole content = position p1 != withtest.p; > ") > > init_defs_builtins: /usr/share/coccinelle/standard.h > 619 620 > Fatal error: exception Failure("minus: parse error: > = File "misc/doubleinit.cocci", line 22, column 21, charpos = 619 > around = ',', whole content = struct I s =@p0 { ..., .fld@p = E, ...}; > ") > > init_defs_builtins: /usr/share/coccinelle/standard.h > 1051 1052 > Fatal error: exception Failure("meta: semantic error: position cannot > be inherited over modifications: p1 > =File "iterators/list_entry_update.cocci", line 40, column 18, charpos = > 1051 > around = ';', whole content = position r.p1,r.p2; > ") > > Back to 1.0.0-rc7; when I tried to build the latest version on my > Debian Squeeze Laptop (2.6.32-5-amd64 #1 SMP, x86_64 GNU/Linux), the > configure script went fine, but during compilation, I get sth like: > > File "parser.ml", line 1, characters 0-1: > Error: Could not find the .cmi file for interface parser.mli. > > Any help is appreciated. :-) > > Thanks, > > Daniel > _______________________________________________ > 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)
