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

[clangd] warning from macOS headers confuse code model

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 16.0.0
    • C/C++/Obj-C++ Support
    • None
    • macOS

    Description

      The clangd code model runs into raises a warning for certain macOS headers using CFBase.h:
      e.g. opening qdarwinaudiodevice_p.h from qtmultimedia/src/multimedia/darwin/qdarwinaudiodevice_p.h warns in

      #if defined(Q_OS_MACOS)
      # include <CoreAudio/CoreAudio.h>
      #endif
      

      with (from the tooltip):

      qdarwinaudiodevice_p.h:20:11: In included file: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators?
      CFBase.h:521:9: error occurred here
      

      observations:

      • the warning is not emitted when building, it's only coming from clangd
      • the warning is only shown when the file is parsed in a c++ parse context, not when inside an obj-c++ context.
      • -Welaborated-enum-base is not added explicitly by the build system, however if i explicitly disable the warning (via -Wno-elaborated-enum-base), clangd is happy
      • clang-tidy and friends seem to have a similar problem (e.g. run clang-tidy on qtmultimedia/src/multimedia/darwin/qdarwinaudiodevice_p.h)

      not sure if clangd/appleclang behave slightly different here, but i wonder if there's an easy workaround for qtc?

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes