facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.92k stars 2.01k forks source link

Query on --changed-files-index option #1808

Open VvinayakK opened 8 months ago

VvinayakK commented 8 months ago

I am trying to run infer on the C makefile project and trying to do incremental analysis only for the changed files.

How to input the changed files in change_list.txt when there are different directories in the project? The guide/tutorial is not clear about this.

Currently my change_list.txt is something like below, but it is not giving proper results during infer run and result in "No such file / directory" error

dir_a\dir_b\a.c
dir_a\b.c

Please help regarding this.

ngorogiannis commented 8 months ago

It looks like the slashes are for a Windows system?

VvinayakK commented 8 months ago

Even upon using backward slash like below in change_list.txt, the result is same.

/dir_a/dir_b/a.c
/dir_a/b.c
ngorogiannis commented 8 months ago

/dir_a/dir_b/a.c is an absolute path (root-relative). I would use paths relative to the directory your sources are rooted at, and run infer from that directory (or, provide --project-root dir to Infer).