On Fri, 17 Oct 2025 at 08:05, Jürgen Spitzmüller <[email protected]> wrote:

> This is probably for Thibaut.
>
> With Qt 6.10, I get two compiler warnings about uses of QThreadStorage:
>
>   488 |                         static QThreadStorage<int> tID;
>       |                                                    ^~~
> /usr/include/qt6/QtCore/qthreadstorage.h:112:70: warning: ‘static
> constexpr void QThreadStorageTraits<true>::warnAboutTrivial()’ is
> deprecated: QThreadStorage used with a trivial non-pointer type;
> consider using thread_local [-Wdeprecated-declarations]
>   112 |     inline QThreadStorage() : d(deleteData) {
> Trait::warnAboutTrivial(); }
>       |
> ~~~~~~~~~~~~~~~~~~~~~~~^~
> /usr/include/qt6/QtCore/qthreadstorage.h:27:27: note: declared here
>    27 |     static constexpr void warnAboutTrivial() noexcept {}
>
>
>
> As you can see, they suggest to use std::thread_local instead. This
> concerns InsetIndex.cpp:488 and xml.cpp:629


The commit that introduced the warning says that we should rather avoid
using QThreadStorage altogether:

>  Stop using QThreadStorage if you can.
https://github.com/qt/qtbase/commit/07a15916cc3c42616251b8ce3345bd77f248d9d8


The devs have been thinking about removing the class, but they couldn't do
it due to bugs in GCC 9 and 10, apparently:
https://bugreports.qt.io/browse/QTBUG-117850. They are preparing the code
base for its removal, it seems:
https://codereview.qt-project.org/c/qt/qtbase/+/192881.

As a first step, I'll try to remove these calls (but I'll have delays to do
so). It should be enough to replace the "static QThreadStorage<int>" by
"thread_local static int".
-- 
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to