[Development] MinGW with UCRT and Qt

Martin Storsjö martin at martin.st
Thu Feb 10 08:31:28 CET 2022

On Thu, 10 Feb 2022, Björn Schäpers wrote:

> I'm upgrading my build environment and switched my MinGW GCC from MSVCRT to 
> UCRT. I'm not very far in compiling Qt, but get the following warnings:
> qdatetime.cpp:2372:35: warning: 'tzname' is deprecated: Only provided for 
> source 
> compatibility; this variable might not always be accurate when linking to 
> UCRT. 
> [-Wdeprecated-declarations]
>     return QString::fromLocal8Bit(tzname[isDst]);
> It seems to me that we should use the #if defined(Q_CC_MSVC) path.
> What would be the best way for that? I don't think you want a #if 
> defined(Q_CC_MSVC) || defined(_UCRT), or do you? Are there any plans to adapt 
> to 

FWIW, the Qt CI does run one mingw toolchain with UCRT (and LLVM instead 
of GCC), and AFAIK it does pass all the tests, so the setup in itself 
shouldn't have any bigger issues. (See e.g. 
https://codereview.qt-project.org/c/qt/qt5/+/394979 for one commit 
updating that tool configuration.)

That said, there's probably still some things that could be done better, 
like this use of 'tzname'.

// Martin

More information about the Development mailing list