Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-8610

issue parser does not handle color diagnostics (ANSI codes) from clang/clang++

XMLWordPrintable

    • 6a7cefbd97cddd0258c394623932723c53472b82

      qtbase/mkspecs/qmodule.pri gives the -fcolor-diagnostics flag to clang and clang++. That's nice in the terminal, but when you do a build in Creator, error messages will have ANSI color codes in them, which are just displayed in ASCII-fied form in the Compile Output pane, e.g.

      qquickabstractfiledialog.cpp:110:7: error: type 'QObject' is not a direct or virtual base of 'QQuickFileDialog'
      : QObject(parent)
       ^~~~~~~

      and they will not show up in the Issues pane at all. If I modify the .pri to give -fno-color-diagnostics, then Creator sees the issues properly. So I suppose we could handle the ANSI codes in the output pane, to color the messages just a like a terminal would do, and the ASCII-fied form which the parser sees should not have those codes. Alternatively Creator could override the compiler flags to omit the color (give -fno-color-diagnostics). But this issue could probably also arise with colorgcc, so maybe handling the ANSI codes is a more universal solution. Even better, the output pane could actually be a full-featured terminal. We will have a QML-based terminal soon enough anyway, and the same problem needs to be solved for that, so it's a good opportunity for some code reuse.

        For Gerrit Dashboard: QTCREATORBUG-8610
        # Subject Branch Project Status CR V

            hunger Tobias Hunger
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes