[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";
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); > ^
Created attachment 358665 [details] Patch
Created attachment 358668 [details] Patch
Comment on attachment 358668 [details] Patch r=me
Comment on attachment 358668 [details] Patch Clearing flags on attachment: 358668 Committed r239812: <https://trac.webkit.org/changeset/239812>
All reviewed patches have been landed. Closing bug.
<rdar://problem/47166229>