Missing temporary files cause errors during Klocwork analysis
If you have a build system that creates temporary source files that are deleted after your build has run, this will cause errors in your analysis results. These temporary source files are captured in the Klocwork build specification and an error is recorded in the analysis results when these temporary files cannot be found.
Note: Not all temporary files should be ignored, such as temporary generated source that is directly or indirectly used by the source that is being analyzed. For more information about these types of files, see Example: Caching temporary source filesBelow is an example of the error in the build.log file:
1> executing: "/space/ta/programs/kw-server-10.4.0.2095/bin/kwcc" "-c" "--security" "--metrics" "--ignore-extension" "--lang" "en" "-o" ... 1> kwcc:Error: Cannot open file /space/ta/csr/conftest.c: No such file 1> kwcc - Klocwork C/C++ Compiler 10.4 (10.4.0 for ix86-pc-linux) 1> kwcc:Error: No files to process. 1> Use '--help' to view help information. 1> Error: command '"/space/ta/programs/kw-server-10.4.0.2095/bin/kwcc" "-c" "--security" "--metrics" "--ignore-extension" "--lang" ...
Workaround: You can eliminate these errors by excluding the temporary files during the build specification creation stage with the --ignore-files option for kwinject:
kwinject --ignore-files <temporary_file_name(s)> <build_command>
For example, if you use 'make' as your build command and you have a temporary file called 'conftext.c' that you want to be excluded in your build specification, the command looks like this:
kwinject --ignore-files "conftest.c" make