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

#if defined(QT_X11_DEFINES_FOUND) in qcborstreamreader.h problem

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 6.0.0 RC
    • 5.15.0, 5.15.1
    • Core: Other
    • None
    • Windows
    • be0f1af3f1829da0d321c12dbd40d5743d3b2eb5 (qt/qtbase/dev)

    Description

      in qcborstreamreader.h there is

      // See qcborcommon.h for why we check
      #if defined(QT_X11_DEFINES_FOUND)
      #  undef True
      #  undef False
      #endif
      

      and in qcborcommon.h

      #if defined(False) && defined(True)
      #  define QT_X11_DEFINES_FOUND 1
      #  undef True
      #  undef False
      #endif
      

      This can lead to includes order hell, if True/False isn't defined when qcborcommon.h is included which QJsonValue does.
      my example is using live555 which defines True/False. If live555 includes do not come before any Qt includes which leads to qcborcommon.h, than the above inĀ  qcborstreamreader.h will not undefine True/False.

      Besides the point using True/False in an enum is poor practice, bridging these #if defined will certainly force a includes order. Proper practice is to also check True/False in qcborstreamreader.h

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            purdueschmidt Justin Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes