How to hide defaulted template parameters in gcc error messages?

后端 未结 2 2067
小鲜肉
小鲜肉 2021-02-13 18:14

Reading through error messages generated by g++ is often a pain because gcc expand names like

std::ostream

in my code into a much longer form

2条回答
  •  感动是毒
    2021-02-13 19:12

    There is no compiler flag to reduce or change the error messages and the related types/templates.

    • gcc suppports coloring since gcc 4.9 with -fdiagnostics-color={auto, always, never}. See the documentation here.

    A number of third party tools exist to help you decrypt error messages:

    • GCCFilter for coloring and simplification of error messages (Perl script)
    • ColorGCC in the same vein (Perl script), git is here.
    • STLFilt : A message filter designed for STL-related diagnostics. Note that it is not supported/developed anymore.

    Also as a (very good) alternative, the clang compiler is very, very good at diagnosis and error messages.

提交回复
热议问题