Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-106980

dladdr() in qlogging.cpp - error: invalid conversion from 'const void*' to 'void*'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.4.1, 6.5.0 Beta1
    • 6.4.0 RC1
    • Core: Other
    • None
    • Other
    • 7d7d4671bd (qt/qtbase/dev) 7d7d4671bd (qt/tqtc-qtbase/dev) f5dda2390f (qt/qtbase/6.4) f5dda2390f (qt/tqtc-qtbase/6.4)

    Description

      Build (Qt 6.4.0RC1) on Solaris fails with:

      /builds/psumbera/userland-qt-6.4/components/desktop/qt6/qt-everywhere-src-6.4.0/qtbase/src/corelib/global/qlogging.cpp:1307:21: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
       1307 | if (!dladdr(addr, &info))
       | ^~~~
       | |
       | const void*
      In file included from /builds/psumbera/userland-qt-6.4/components/desktop/qt6/qt-everywhere-src-6.4.0/qtbase/mkspecs/solaris-g++-64/qplatformdefs.h:28,
       from /builds/psumbera/userland-qt-6.4/components/desktop/qt6/build/amd64/qtbase/include/QtCore/6.4.1/QtCore/private/../../../../../../../../qt-everywhere-src-6.4.0/qtbase/src/corelib/kernel/qcore_unix_p.h:19,
       from /builds/psumbera/userland-qt-6.4/components/desktop/qt6/build/amd64/qtbase/include/QtCore/6.4.1/QtCore/private/qcore_unix_p.h:1,
       from /builds/psumbera/userland-qt-6.4/components/desktop/qt6/qt-everywhere-src-6.4.0/qtbase/src/corelib/global/qlogging.cpp:62:
      /usr/include/dlfcn.h:96:24: note: initializing argument 1 of 'int dladdr(void*, Dl_info*)'
       96 | extern int dladdr(void *, Dl_info *);
       | ^~~~~~

      This change avoids the problem:

      --- qt-everywhere-src-6.4.0/qtbase/src/corelib/global/qlogging.cpp
      +++ qt-everywhere-src-6.4.0/qtbase/src/corelib/global/qlogging.cpp
      @@ -1304,7 +1304,7 @@
       const char *cachedFname = nullptr;
       auto decodeFrame = [&](const void *addr) -> DecodedFrame {
       Dl_info info;
      - if (!dladdr(addr, &info))
      + if (!dladdr((void*)addr, &info))
       return {};
      // These are actually UTF-8, so we'll correct below
      

       

       

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            psumbera Petr Šumbera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes