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

CBOR classes introduce symbols which conflict with X11-based code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.0 Alpha
    • 5.12
    • Core: Other
    • None
    • Linux/X11
    • 4b10298de54a7cacb5f25601f8e3ae5d233806d3

    Description

      The new CBOR classes in qtbase/src/corelib/serialization employ the use of an enum for 'simple types', which defines values like

      enum class QCborSimpleType : quint8 {
           False = 20, 
           True = 21, 
           Null = 22, 
           Undefined = 23 
      };
      

      This definition conflicts with the use of X11 codes (which use #define commands for True and for False), which breaks compilation of 3 KDE repositories (kscreenlocker, kwin, and plasma-workspace).

      Usually one can work around X11 symbol pollution by #undef'ing the excess symbols (KDE uses a "fixx11h.h" include which does this for most symbols). However the True/False symbols are the documented proper values to use for many X11 calls and so this would affect most X11 users even if they already employ a similar namespace cleanup hack.

      Making this more interesting is that it's very easy to end up pulling in the qcborcommon.h header (e.g. QtDBus pulls in all of QtCore), so it's not just a matter of making sure to have the right include order like most X11 problems come down to.

      I have a patch for Qt that fixes the build for all 3 KDE repositories I experienced failures on, which I will post separately.

      Attachments

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

        Activity

          People

            mpyne Michael Pyne
            mpyne Michael Pyne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes