[Development] MinGW with UCRT and Qt

Björn Schäpers qt-maillist at hazardy.de
Thu Feb 10 09:32:33 CET 2022


Am 10.02.2022 um 05:06 schrieb Thiago Macieira:
> On Wednesday, 9 February 2022 16:35:00 PST Björn Schäpers wrote:
>> Hi,
>>
>> 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.
> Yes.
>
>> 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?
> No, an #ifdef _UCRT should suffice.

I'm not sure I understood correctly. Should there only be an #ifdef _UCRT? Does 
MSVC also define that? I couldn't find anything that suggests that.

> There'll be a lot of those places to fix because we haven't paid attention to
> the CRT until now. Moreover, there wasn't an UCRT until VS 2015, but many of
> the functions in question (including _get_tzname) have been available since VS
> 2008 or earlier.
>
>>   Are there any plans to adapt to UCRT MinGW?
> Once it's officially supported by upstream, with default toolchain builds, we
> should switch.
>
What is upstream in this case? As far as I can see in msys2 they're heavy 
working on getting everything (64 bit) to UCRT.



More information about the Development mailing list