Bug 192583 - [Win][Clang] Fix compilation warnings of WTF
Summary: [Win][Clang] Fix compilation warnings of WTF
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks: 171618
  Show dependency treegraph
 
Reported: 2018-12-11 00:08 PST by Fujii Hironori
Modified: 2018-12-11 17:36 PST (History)
10 users (show)

See Also:


Attachments
Patch (4.78 KB, patch)
2018-12-11 00:18 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch for landing (4.76 KB, patch)
2018-12-11 17:25 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2018-12-11 00:08:19 PST
[Win][Clang] Fix compilation warnings of WTF

clang-cl reports the following warnings.

> [92/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\StackBounds.cpp.obj
> ..\..\Source\WTF\wtf\StackBounds.cpp(163,48):  warning: missing field 'AllocationBase' initializer [-Wmissing-field-initializers]
>     MEMORY_BASIC_INFORMATION stackOrigin = { 0 };
>                                                ^
> 1 warning generated.
> [160/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\win\RunLoopWin.cpp.obj
> ..\..\Source\WTF\wtf\win\RunLoopWin.cpp(34,54):  warning: ISO C++11 does not allow conversion from string literal to 'const LPWSTR' (aka 'wchar_t *const') [-Wwritable-strings]
> static const LPWSTR kRunLoopMessageWindowClassName = L"RunLoopMessageWindow";
>                                                      ^
> ..\..\Source\WTF\wtf\win\RunLoopWin.cpp(86,32):  warning: missing field 'lpfnWndProc' initializer [-Wmissing-field-initializers]
>     WNDCLASS windowClass = { 0 };
>                                ^
> 2 warnings generated.
> [175/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\DateMath.cpp.obj
> ..\..\Source\WTF\wtf\DateMath.cpp(125,20):  warning: unused function 'getLocalTime' [-Wunused-function]
> static inline void getLocalTime(const time_t* localTime, struct tm* localTM)
>                    ^
> 1 warning generated.
> [180/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\Assertions.cpp.obj
> ..\..\Source\WTF\wtf\Assertions.cpp(263,1):  warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
> }
> ^
> 1 warning generated.
Comment 1 Fujii Hironori 2018-12-11 00:18:45 PST
Created attachment 357041 [details]
Patch
Comment 2 Ross Kirsling 2018-12-11 09:19:36 PST
Comment on attachment 357041 [details]
Patch

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

> Source/WTF/wtf/StackBounds.cpp:163
> -    MEMORY_BASIC_INFORMATION stackOrigin = { 0 };
> +    MEMORY_BASIC_INFORMATION stackOrigin = { };

We should probably remove the = here.
(I guess if the default constructor works then we don't necessarily need the { } either, but it doesn't hurt to keep it.)

> Source/WTF/wtf/win/RunLoopWin.cpp:86
> -    WNDCLASS windowClass = { 0 };
> +    WNDCLASS windowClass = { };

Ditto.
Comment 3 Fujii Hironori 2018-12-11 17:20:12 PST
Comment on attachment 357041 [details]
Patch

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

>> Source/WTF/wtf/StackBounds.cpp:163
>> +    MEMORY_BASIC_INFORMATION stackOrigin = { };
> 
> We should probably remove the = here.
> (I guess if the default constructor works then we don't necessarily need the { } either, but it doesn't hurt to keep it.)

Good catch. Thanks. Will fix.
Unfortunately, Windows API is implemented in C. It doesn't have ctor.
https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_memory_basic_information
Comment 4 Fujii Hironori 2018-12-11 17:25:12 PST
Created attachment 357090 [details]
Patch for landing
Comment 5 Fujii Hironori 2018-12-11 17:35:05 PST
Committed r239093: <https://trac.webkit.org/changeset/239093>
Comment 6 Radar WebKit Bug Importer 2018-12-11 17:36:29 PST
<rdar://problem/46647928>