Any tips for speeding up static analysis tool PC-Lint? Any experiences using .LOB files?

我是研究僧i 提交于 2020-01-02 15:03:24

问题


I'm interested in learning the main factors which affect PC-lint-ing time. I'm aware of a few such as -passes(#) which will increase the time PC-Lint takes (increase linearly?) or that reducing the messages which are output does not affect the linting time. I'm hoping to verify my understanding of lint's performance by having one of you who is more experienced with lint list the main factors they've encountered that affect linting time.

Also, do any of you have experience using .lob files with PC-Lint. How much would you say it affected linting time?


回答1:


The main speedup I got was when I started redirecting Lint's sometimes massive output to a file in stead of a regular DOS box on Windows, and then look at the file in an editor. The -passes option does almost linearly increase the time if the number of passes gets high enough, but not quite when using 2 or 3, since a pre-pocessing/parsing stage is not needed except for the first pass. I my experience, for really large projects, external include guards, or (Microsoft) the option +pragma(once,once) - if #pragma once is consistently used - may result in enormous speed increases. In one project I dropped compile times by a factor of more than 20, and linting times just a little less...

Using .lob files is like compiling to objects and then linking objects: It depends on how effective your makefile is, and the speed increase depends on how many and which files you have just changed. Be aware, though, that using .lob files is not as thorough as linting all files in one go; some issues have to be ignored, because the .lob files contain only a representation of the source files.



来源:https://stackoverflow.com/questions/13562541/any-tips-for-speeding-up-static-analysis-tool-pc-lint-any-experiences-using-lo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!