On Saturday, 1 July 2023 06:37:20 PDT Yauheni Pervenenka via Interest wrote: > Hi, Konstantin, thanks for your reply, I have attached stack when QObject > created first time, the problem is that UB is already exists in Qt,
No, it doesn't. > Q_CONSTRUCTOR_FUNCTION(initialize) and QBasicAtomicPointer<QThread> > QCoreApplicationPrivate::theMainThread = > Q_BASIC_ATOMIC_INITIALIZER(nullptr); > should be called in next order, first should be initialized theMainThread > and after should be called Q_CONSTRUCTOR_FUNCTION(initialize) but it is not > guaranteed by standard, https://en.cppreference.com/w/cpp/language/siof Nope. The QBasicAtomicPointer is initialised at static time, meaning it is initialised *before* any code runs. It's guaranteed by the standard. Your diagnosis is incorrect. -- Thiago Macieira - thiago.macieira (AT) intel.com Cloud Software Architect - Intel DCAI Cloud Engineering
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest