Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.15.0, 5.15.1
-
None
-
-
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