title: Telling gcc diagnostics apart
body: <p>I have a problem interpreting gcc (4.8.2) warnings &amp; errors. More precisely, it's difficult to tell where one problem ends and another one starts. I have console-only access to the build machine, so using an IDE is not an option.</p>
  
  <p>I really need to be able to tell individual issues apart quickly. Is there a way to make GCC insert something between distinct diagnostic messages?</p>
  
  <p>Here is an example output I am getting:</p>
  
  <pre><code>/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&lt;xmodel::Core::IDataItem&gt;) 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(&lt;unresolved overloaded function type&gt;, const std::_Placeholder&lt;1&gt;&amp;, const QUuid&amp;)’
         , std::bind(&amp;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&lt;class _Func, class ... _BoundArgs&gt; typename std::_Bind_helper&lt;std::__or_&lt;std::is_integral&lt;typename std::decay&lt;_Tp&gt;::type&gt;, std::is_enum&lt;typename std::decay&lt;_Tp&gt;::type&gt; &gt;::value, _Func, _BoundArgs ...&gt;::type std::bind(_Func&amp;&amp;, _BoundArgs&amp;&amp; ...)
       bind(_Func&amp;&amp; __f, _BoundArgs&amp;&amp;... __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(&amp;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&lt;class _Result, class _Func, class ... _BoundArgs&gt; typename std::_Bindres_helper&lt;_Result, _Func, _BoundArgs&gt;::type std::bind(_Func&amp;&amp;, _BoundArgs&amp;&amp; ...)
       bind(_Func&amp;&amp; __f, _BoundArgs&amp;&amp;... __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(&amp;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]
   }
   ^
  </code></pre>
  
  <p>This one is not even so bad, actually, as there are no macro expansions involved (we use Boost.Preprocessor as well). Still, it's awfully difficult to tell at a glance that this output is about two problems, the second one on the last 3 lines and the first one taking up the entire wall of text before that.</p>
  
  <p>Is there a way to get some separator inserted between them? Even a blank line would do, something you could Search or <code>grep</code> for.</p>
  
  <p>I've read the <a href="http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Language-Independent-Options.html#Language-Independent-Options" rel="noreferrer">GCC docs on Options to Control Diagnostic Messages Formatting</a>, but I couldn't find anything. <code>[</code> is also not usable as a search anchor, because not all the messages have one (the first one above doesn't). I'm out of ideas.</p>