【发布时间】:2020-02-25 02:22:25
【问题描述】:
我正在尝试在 cppcheck 中使用 xml 转储文件来创建我的规则。当我查看运行 cppcheck 时生成的转储文件时,我看到标记 rawtokens 具有列表文件相关和文件中的原始数据。
<rawtokens>
<file index="0" name="qtProject/untitled1/teststatistic.cpp"/>
<file index="1" name="qtProject/untitled1/teststatistic.h"/>
但我只看到原始数据 fileIndex = 0
<tok fileIndex="0" linenr="1" column="1" str="#"/>
<tok fileIndex="0" linenr="1" column="2" str="include"/>
<tok fileIndex="0" linenr="1" column="10" str=""teststatistic.h""/>
<tok fileIndex="0" linenr="4" column="1" str="TestStatistic"/>
<tok fileIndex="0" linenr="4" column="14" str="::"/>
<tok fileIndex="0" linenr="4" column="16" str="TestStatistic"/>
<tok fileIndex="0" linenr="4" column="29" str="("/>
<tok fileIndex="0" linenr="4" column="30" str=")"/>
<tok fileIndex="0" linenr="5" column="1" str="{"/>
<tok fileIndex="0" linenr="7" column="1" str="}"/>
</rawtokens>
cppcheck 中是否有任何选项可以显示 rawtokens 中所有文件列表中的原始数据?
命令我生成文件转储: cppcheck --dump teststatistic.cpp
【问题讨论】:
-
当我在文件 cppcheck.cpp 中查看源代码 cppcheck 时,函数 checkFile。似乎没有列出所有原始数据的选项。那么如何更改源代码以显示所有原始数据。谢谢。