当您收到这样的警告时,是否有一种聪明的方法可以在代码中找到相关位置?显示的唯一行号似乎是指标准标题,而不是实际代码。我必须补充一点,这个项目非常大,有数百个模块和 1MLOC+。
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\utility(138): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xtree(1804) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2>::pair<std::_Tree_iterator<_Mytree>,int>(_Other1 &&,_Other2 &&,void **)' being compiled
with
[
_Ty1=std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const std::string,tpuTask >>>>,
_Ty2=bool,
_Mytree=std::_Tree_val<std::_Tree_simple_types<std::pair<const std::string,tpuTask >>>,
_Other1=std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const std::string,tpuTask >>>>,
_Other2=int
]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xtree(1804) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2>::pair<std::_Tree_iterator<_Mytree>,int>(_Other1 &&,_Other2 &&,void **)' being compiled
with
[
_Ty1=std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const std::string,tpuTask >>>>,
_Ty2=bool,
_Mytree=std::_Tree_val<std::_Tree_simple_types<std::pair<const std::string,tpuTask >>>,
_Other1=std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const std::string,tpuTask >>>>,
_Other2=int
]
...