Bug 192693

Summary: [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: PlatformAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, don.olmstead, pvollan, ross.kirsling, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 171618    
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Fujii Hironori 2018-12-13 21:18:30 PST
[Win][Clang] Fix compilation warnings under Source/WebCore/platform/win

clang-cl reports the following compilation warnings.

> ..\..\Source\WebCore\platform\win\DefWndProcWindowClass.cpp(48,17):  warning: unused variable 'atom' [-Wunused-variable]
> ..\..\Source\WebCore\platform\win\PlatformMouseEventWin.cpp(87,7):  warning: field 'm_didActivateWebView' will be initialized after field 'm_modifierFlags' [-Wreorder]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(173,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(179,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(185,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(191,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(197,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(203,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(209,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(215,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(227,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(244,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(254,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\CursorWin.cpp(257,45):  warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp(702,101):  warning: field 'format' will be initialized after field 'getString' [-Wreorder]
> ..\..\Source\WebCore\platform\win\DragImageWin.cpp(99,13):  warning: unused variable 'MinDragLabelWidthBeforeClip' [-Wunused-const-variable]
> ..\..\Source\WebCore\platform\win/PopupMenuWin.h(45,18):  warning: 'show' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
> ..\..\Source\WebCore\platform\win/PopupMenuWin.h(46,18):  warning: 'hide' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
> ..\..\Source\WebCore\platform\win/PopupMenuWin.h(47,18):  warning: 'updateFromElement' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
> ..\..\Source\WebCore\platform\win/PopupMenuWin.h(48,18):  warning: 'disconnectClient' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
> ..\..\Source\WebCore\platform\win\PopupMenuWin.cpp(612,9):  warning: unused variable 'itemCount' [-Wunused-variable]
> ..\..\Source\WebCore\platform\win\PopupMenuWin.cpp(826,11):  warning: unused variable 'smoothScrollAnimationDuration' [-Wunused-const-variable]
> ..\..\Source\WebCore\platform\win\PasteboardWin.cpp(891,13):  warning: unused variable 'hr' [-Wunused-variable]
> ..\..\Source\WebCore\platform\win\PasteboardWin.cpp(1018,12):  warning: cast from 'DROPFILES *' (aka '_DROPFILES *') to 'LPWSTR' (aka 'wchar_t *') increases required alignment from 1 to 2 [-Wcast-align]
> ..\..\Source\WebCore\platform\win\DragImageCairoWin.cpp(125,9):  warning: jump from this goto statement to its label is a Microsoft extension [-Wmicrosoft-goto]
> ..\..\Source\WebCore\platform\win\DragImageCairoWin.cpp(120,9):  warning: jump from this goto statement to its label is a Microsoft extension [-Wmicrosoft-goto]
> ..\..\Source\WebCore\platform\win/StructuredExceptionHandlerSuppressor.h(48,11):  warning: private field 'm_savedExceptionRegistration' is not used [-Wunused-private-field]
> ..\..\Source\WebCore\platform\win\SSLKeyGeneratorWin.cpp(32,15):  warning: extra qualification on member 'getSupportedKeySizes' [-Wextra-qualification]
> ..\..\Source\WebCore\platform\win\SSLKeyGeneratorWin.cpp(38,17):  warning: extra qualification on member 'signedPublicKeyAndChallengeString' [-Wextra-qualification]
> ..\..\Source\WebCore\platform\win\SSLKeyGeneratorWin.cpp(65,43):  warning: ISO C++11 does not allow conversion from string literal to 'LPWSTR' (aka 'wchar_t *') [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\SSLKeyGeneratorWin.cpp(75,29):  warning: ISO C++11 does not allow conversion from string literal to 'LPSTR' (aka 'char *') [-Wwritable-strings]
> ..\..\Source\WebCore\platform\win\SystemInfo.cpp(83,13):  warning: 10 enumeration values not handled in switch: 'WindowsCE5', 'WindowsCE6', 'WindowsCE7'... [-Wswitch]
> ..\..\Source\WebCore\platform\win/PopupMenuWin.h(45,18):  warning: 'show' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
> ..\..\Source\WebCore\platform\win/PopupMenuWin.h(46,18):  warning: 'hide' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
> ..\..\Source\WebCore\platform\win/PopupMenuWin.h(47,18):  warning: 'updateFromElement' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
> ..\..\Source\WebCore\platform\win/PopupMenuWin.h(48,18):  warning: 'disconnectClient' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
> ..\..\Source\WebCore\platform\win\SearchPopupMenuDB.cpp(286,9):  warning: unused variable 'ret' [-Wunused-variable]
Comment 1 Fujii Hironori 2018-12-13 21:42:46 PST
Created attachment 357299 [details]
Patch
Comment 2 Ross Kirsling 2018-12-13 22:55:23 PST
Comment on attachment 357299 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=357299&action=review

> Source/WebCore/ChangeLog:31
> +        (WebCore::osVersionForUAString): Added defalut case.

Nit: "default"

> Source/WebCore/platform/win/PopupMenuWin.cpp:612
> -    // listRect is the damageRect translated into the coordinates of the entire menu list (which is itemCount * m_itemHeight pixels tall)
> +    // listRect is the damageRect translated into the coordinates of the entire menu list (which is itemSize * m_itemHeight pixels tall)

Did you mean "listSize"? I don't see an "itemSize"...
Comment 3 Fujii Hironori 2018-12-13 23:41:56 PST
Comment on attachment 357299 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=357299&action=review

>> Source/WebCore/platform/win/PopupMenuWin.cpp:612
>> +    // listRect is the damageRect translated into the coordinates of the entire menu list (which is itemSize * m_itemHeight pixels tall)
> 
> Did you mean "listSize"? I don't see an "itemSize"...

Oh, that's right. Thanks.
Comment 4 Fujii Hironori 2018-12-14 00:01:12 PST
Created attachment 357305 [details]
Patch for landing
Comment 5 Fujii Hironori 2018-12-14 00:10:50 PST
Comment on attachment 357305 [details]
Patch for landing

Clearing flags on attachment: 357305

Committed r239201: <https://trac.webkit.org/changeset/239201>
Comment 6 Fujii Hironori 2018-12-14 00:10:53 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-12-14 00:11:43 PST
<rdar://problem/46723806>