我在解释 gcc (4.8.2) 警告和错误时遇到问题。更准确地说,很难分辨一个问题在哪里结束,另一个问题从哪里开始。我只能通过控制台访问构建机器,因此不能选择使用 IDE。
我真的需要能够快速区分个别问题。有没有办法让 GCC 在不同的诊断消息之间插入一些东西?
这是我得到的示例输出:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp: In member function ‘virtual bool xmodel::Core::DataItemCollection::tryAdditionalItemRegistration(std::shared_ptr<xmodel::Core::IDataItem>) const’:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: error: no matching function for call to ‘bind(<unresolved overloaded function type>, const std::_Placeholder<1>&, const QUuid&)’
, std::bind(&IDataItemCollectionScope::findItemById, _1, id)
^
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note: candidates are:
In file included from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/bits/stl_algo.h:66:0,
from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/algorithm:62,
from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qglobal.h:68,
from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qatomic.h:45,
from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qhash.h:45,
from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/QHash:1,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/rappserv/code/include/convenience/stdhash_quuid.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/ItemId.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItem.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/DataItemDescriptor.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItemCollection.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:9:
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1655:5: note: template<class _Func, class ... _BoundArgs> typename std::_Bind_helper<std::__or_<std::is_integral<typename std::decay<_Tp>::type>, std::is_enum<typename std::decay<_Tp>::type> >::value, _Func, _BoundArgs ...>::type std::bind(_Func&&, _BoundArgs&& ...)
bind(_Func&& __f, _BoundArgs&&... __args)
^
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1655:5: note: template argument deduction/substitution failed:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note: couldn't deduce template parameter ‘_Func’
, std::bind(&IDataItemCollectionScope::findItemById, _1, id)
^
In file included from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/bits/stl_algo.h:66:0,
from /gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/algorithm:62,
from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qglobal.h:68,
from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qatomic.h:45,
from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/qhash.h:45,
from /gl-sync/thirdparty/Qt/4.8.4/lnx_x23.64/include/QtCore/QHash:1,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/rappserv/code/include/convenience/stdhash_quuid.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/ItemId.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItem.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/DataItemDescriptor.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/include/xmodel/core/IDataItemCollection.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.h:11,
from /usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:9:
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1682:5: note: template<class _Result, class _Func, class ... _BoundArgs> typename std::_Bindres_helper<_Result, _Func, _BoundArgs>::type std::bind(_Func&&, _BoundArgs&& ...)
bind(_Func&& __f, _BoundArgs&&... __args)
^
/gl-sync/compilers/gcc/4.8.2/sle11sp0/include/c++/4.8.2/functional:1682:5: note: template argument deduction/substitution failed:
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:414:66: note: couldn't deduce template parameter ‘_Result’
, std::bind(&IDataItemCollectionScope::findItemById, _1, id)
^
/usr2/viewstore_some/xy01/xy01_unix1/fubar/extensions/xmodel/core/code/src/DataItemCollection.cpp:417:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
实际上,这还不算太糟糕,因为没有涉及宏扩展(我们也使用 Boost.Preprocessor)。尽管如此,很难一眼看出这个输出是关于两个问题的,第二个在最后 3 行,第一个占据了之前的整个文本墙。
有没有办法在它们之间插入一些分隔符?即使是空行也可以,您可以搜索或grep
搜索。
我已经阅读了关于 Options to Control Diagnostic Messages Formatting 的 GCC 文档,但我找不到任何东西。[
也不能用作搜索锚,因为并非所有消息都有一个(上面的第一个没有)。我没主意了。