RESOLVED FIXED 193271
[Win][MiniBrowser] wchar_t strings shouldn't be treated as BSTR
https://bugs.webkit.org/show_bug.cgi?id=193271
Summary [Win][MiniBrowser] wchar_t strings shouldn't be treated as BSTR
Fujii Hironori
Reported 2019-01-08 20:26:54 PST
[Win][WebKitLegacy] wchar_t strings shouldn't be treated as BSTR BSTR | Microsoft Docs https://docs.microsoft.com/en-us/previous-versions/windows/desktop/automat/bstr > A BSTR is a composite data type that consists of a length prefix, a data string, and a terminator. > The following code is incorrect: > > BSTR MyBstr = L"I am a happy BSTR";
Attachments
Patch (2.05 KB, patch)
2019-01-08 20:45 PST, Fujii Hironori
no flags
Patch (2.78 KB, patch)
2019-01-08 20:54 PST, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2019-01-08 20:31:12 PST
clang-cl reports the following warnings: > ..\..\Tools\MiniBrowser\win\MiniBrowserWebHost.cpp(170,38): warning: ISO C++11 does not allow conversion from string literal to 'BSTR' (aka 'wchar_t *') [-Wwritable-strings] > HRESULT hr = doc->getElementById(L"webkit logo", &element.GetInterfacePtr()); > ^ > ..\..\Tools\MiniBrowser\win\MiniBrowserWebHost.cpp(178,70): warning: ISO C++11 does not allow conversion from string literal to 'LPWSTR' (aka 'wchar_t *') [-Wwritable-strings] > hr = target->addEventListener(L"click", new SimpleEventListener (L"webkit logo click"), FALSE); > ^ > ..\..\Tools\MiniBrowser\win\MiniBrowserWebHost.cpp(178,35): warning: ISO C++11 does not allow conversion from string literal to 'BSTR' (aka 'wchar_t *') [-Wwritable-strings] > hr = target->addEventListener(L"click", new SimpleEventListener (L"webkit logo click"), FALSE); > ^
Fujii Hironori
Comment 2 2019-01-08 20:45:33 PST
Fujii Hironori
Comment 3 2019-01-08 20:54:57 PST
Brent Fulgham
Comment 4 2019-01-08 20:59:20 PST
Comment on attachment 358668 [details] Patch r=me
Fujii Hironori
Comment 5 2019-01-09 18:06:07 PST
Comment on attachment 358668 [details] Patch Clearing flags on attachment: 358668 Committed r239812: <https://trac.webkit.org/changeset/239812>
Fujii Hironori
Comment 6 2019-01-09 18:06:09 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2019-01-09 18:09:29 PST
Note You need to log in before you can comment on or make changes to this bug.