使用 –-whatisnew 选项可通过与以前保存的工具报告比较,生成仅包含新错误的报告。例如,使用代码分析工具可创建采用工具时源代码库状态的冻结副本。然后,可使用 –-whatisnew 确保对源代码库的继续更改不会形成新的安全漏洞。
以下是使用 –-whatisnew 以仅显示新错误的一个示例:
%codean --whatisnew a.out STATIC report of a.out showing new issues: Compare the latest results against a.out.analyze/history/09:58:35May152013... MEMORY LEAK 1 : 1 block left allocated on heap with a total size of 400 bytes sample1() <sample1.c : 20> 17: { 18: global = (int *)malloc(100); 19: int *p = malloc(100*sizeof(int)); 20:=> int *q = malloc(100*sizeof(int)); 22: add_0_1_put_in_2(p);– PREVISE SUMMARY: 0 new error(s), 0 new warning(s), 1 new leak(s) in total