[Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT' While trying to build WebKit WinCairo port with the latest Clang (Bug 171618), the following compilation errors are reported. > [4/664] Building CXX object Source\WebCore\CMakeFiles\WebCore.dir\platform\graphics\win\IntPointWin.cpp.obj > FAILED: Source/WebCore/CMakeFiles/WebCore.dir/platform/graphics/win/IntPointWin.cpp.obj > C:\tools\llvm\bin\clang-cl.exe (...) -c ..\..\Source\WebCore\platform\graphics\win\IntPointWin.cpp > ..\..\Source\WebCore\platform\graphics\win\IntPointWin.cpp(56,17): error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT' (aka 'short') in initializer list [-Wc++11-narrowing] > POINTS p = {m_x, m_y}; > ^~~ > ..\..\Source\WebCore\platform\graphics\win\IntPointWin.cpp(56,17): note: insert an explicit cast to silence this issue > POINTS p = {m_x, m_y}; > ^~~ > static_cast<SHORT>( ) > ..\..\Source\WebCore\platform\graphics\win\IntPointWin.cpp(56,22): error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT' (aka 'short') in initializer list [-Wc++11-narrowing] > POINTS p = {m_x, m_y}; > ^~~ > ..\..\Source\WebCore\platform\graphics\win\IntPointWin.cpp(56,22): note: insert an explicit cast to silence this issue > POINTS p = {m_x, m_y}; > ^~~ > static_cast<SHORT>( ) > 2 errors generated. > [15/31] Building CXX object Source\WebKit\CMakeFiles\WebKit.dir\UIProcess\win\WebInspectorProxyWin.cpp.obj > FAILED: Source/WebKit/CMakeFiles/WebKit.dir/UIProcess/win/WebInspectorProxyWin.cpp.obj > C:\tools\llvm\bin\clang-cl.exe (...) -c ..\..\Source\WebKit\UIProcess\win\WebInspectorProxyWin.cpp > ..\..\Source\WebKit\UIProcess\win\WebInspectorProxyWin.cpp(234,22): error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'LONG' (aka 'long') in initializer list [-Wc++11-narrowing] > RECT r = { 0, 0, initialWindowWidth, initialWindowHeight }; > ^~~~~~~~~~~~~~~~~~ > ..\..\Source\WebKit\UIProcess\win\WebInspectorProxyWin.cpp(234,22): note: insert an explicit cast to silence this issue > RECT r = { 0, 0, initialWindowWidth, initialWindowHeight }; > ^~~~~~~~~~~~~~~~~~ > static_cast<LONG>() > ..\..\Source\WebKit\UIProcess\win\WebInspectorProxyWin.cpp(234,42): error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'LONG' (aka 'long') in initializer list [-Wc++11-narrowing] > RECT r = { 0, 0, initialWindowWidth, initialWindowHeight }; > ^~~~~~~~~~~~~~~~~~~ > ..\..\Source\WebKit\UIProcess\win\WebInspectorProxyWin.cpp(234,42): note: insert an explicit cast to silence this issue > RECT r = { 0, 0, initialWindowWidth, initialWindowHeight }; > ^~~~~~~~~~~~~~~~~~~ > static_cast<LONG>( ) > 2 errors generated.
Created attachment 349539 [details] Patch
Comment on attachment 349539 [details] Patch Clearing flags on attachment: 349539 Committed r235942: <https://trac.webkit.org/changeset/235942>
All reviewed patches have been landed. Closing bug.
<rdar://problem/44386326>