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

Plugin for clang code model shouldn't hardcode include path

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11, Linux/Other display system
    • b5b9b7e32c26245ad5f6d41a31be036f30088ea3

    Description

      Qt Creator's plugin for the clang code model shouldn't hard code the include path for clang.

      Hard coding the path leads to issues like https://bugs.archlinux.org/task/56821 where the code model is broken with the error message `fatal error: 'stddef.h' file not found`. The problem was also recently observed on Tumbleweed.

      In fact, likely any distribution is affected unless they rebuild Qt Creator after updating clang. Since the include path contains the full version of clang (e.g. `/usr/lib64/clang/7.0.0/include`) the rebuild would be required forĀ every update and not only major releases.

      This bug is similar to https://bugreports.qt.io/browse/QTBUG-70687.

      So far I only reproduced this with Qt Creator 4.5.0 and 4.8.0 but other versions are likely affected as well.

      Suggested fix: The path is somehow detected at compile time. So in theory it must be possible to move that logic to Qt Creator's run-time code so it is able to detect the path dynamically.

      By the way: I'm aware that one can already find similar tickets when searching for "stddef.h" on this bug tracker. Likely these tickets are related. However, none of them states clearly the source of the problem so I created a new ticket which is hopefully concrete enough so someone is able to work on it.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kandeler Christian Kandeler
              martchus martchus
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes