How to Run PC-Lint on only locally modified files(Not commited on Server of SVN)

259 views Asked by At

I am trying to write script to run PC-Lint Static analyzer tool on only locally modified files by user and not on whole project.

For that I need to run Lint command on all locally modified files

using svn status

 svn status -u | grep -w M 

command I get list of locally modified files with its full path

For Example if locally modified file is asn1_common_elements.c, the above svn command will give output as M 10014 \Implementations\asn1der\src\asn1_common_elements.c

now I need to take only filename asn1_common_elements.c and put it with LINT command as LINT asn1_common_elements.log (instead of .c need to change to .log) How can I achieve this?

1

There are 1 answers

0
Tedi On

You could use a Makefile's ability to only let the compiler to compile only the changed files.

Do something like this in the Makefile:

# Create object from C source code
file.o: file.c
    gcc                -c $(CFLAGS) -o $@
    wine lint-nt.exe   file.c

Now the file.c will get analysed only when it is changed.