Hello, I am trying to run coccicheck on KNEM (http://runtime.bordeaux.inria.fr/knem/) and I can't understand what it is complaining about. I am using coccicheck 0.2.4 (with a couple fixes to make it work with coccinelle 0.2.2). After running, all my results/*.out files are empty, except malloc.out (attached). I can't believe coccicheck is telling me that I should removed the lines mentioned in this diff patch since my malloc is certainly needed :) So I guess I just don't understand what coccicheck is saying. Would you mind helping me?
By the way, I had to replace all my #include "foo.h" with <foo.h> since Coccinelle doesn't seem to find foo.h even if -I mylocaldir is properly given to spatch. Is this a known problem? thank you Brice Goglin
diff -u -p /home/bgoglin/knem/trunk/tools/knem_collectives.c /tmp/nothing
--- /home/bgoglin/knem/trunk/tools/knem_collectives.c 2010-05-04
11:45:48.000000000 +0200
+++ /tmp/nothing
@@ -579,7 +579,6 @@ int main(int argc, char * argv[])
goto out;
}
- pids = malloc((nprocs-1) * sizeof(*pids));
if (!pids) {
fprintf(stderr, "malloc pids\n");
err = 1;
@@ -612,7 +611,6 @@ int main(int argc, char * argv[])
fd = open("/dev/knem", O_RDWR);
if (fd < 0) {
perror("open");
- goto out;
}
err = ioctl(fd, KNEM_CMD_GET_INFO, &info);
@@ -706,5 +704,4 @@ int main(int argc, char * argv[])
free(pids);
out:
free(binding);
- return err;
}
init_defs_builtins: /usr/share/coccinelle/standard.h HANDLING: /home/bgoglin/knem/trunk/driver/linux/knem_main.c No matches found for malloc Skipping:/home/bgoglin/knem/trunk/driver/linux/knem_main.c HANDLING: /home/bgoglin/knem/trunk/tools/knem_loopback.c HANDLING: /home/bgoglin/knem/trunk/tools/knem_multifd_test.c Note: processing took 48.7s: /home/bgoglin/knem/trunk/tools/knem_multifd_test.c HANDLING: /home/bgoglin/knem/trunk/tools/knem_status_test.c HANDLING: /home/bgoglin/knem/trunk/tools/knem_collectives.c diff = HANDLING: /home/bgoglin/knem/trunk/tools/knem_pingpong.c HANDLING: /home/bgoglin/knem/trunk/tools/knem_vect_test.c
malloc.sh
Description: application/shellscript
_______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
