Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.9.0 Beta 2
-
None
-
f46977ae785632e52fc7212265f2e1e0d38565db
Description
In function 'QNetworkInfoPrivate::networkName' (see file 'src\qtsystems\src\systeminfo\windows\qnetworkinfo_win.cpp'):
for (uint i = 0; i < ssid.uSSIDLength;i++) {
QString temp = ssid.ucSSID[i];
netname += temp;
}
'ssid.ucSSID[I]' has type 'UCHAR' (unsigned char).
It can be simplified as:
using uchar = unsigned char; struct QChar { QChar(int); explicit QChar(uchar); }; struct QString { QString(QChar); }; void f() { uchar c = 0; QString s = c; }
This code is ill-formed because it involves two user-defined conversions. 'c' to 'QChar', then 'QChar' to 'QString'.
MSVC allows two user-defined conversions by default. When /permissive- is used, it will align with other compilers and reject the code.
Based on my limited understanding of the code, looks that the intention is to use QChar and it will fix the code:
QChar temp = ssid.ucSSID[i]; netname += temp;