Summary: | [Win] Warning fix. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Per Arne Vollan <pvollan> | ||||||||
Component: | JavaScriptCore | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, commit-queue, dbates, don.olmstead, ews-watchlist, Hironori.Fujii, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer, ysuzuki | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Per Arne Vollan
2017-09-15 09:07:08 PDT
I saw following JSC compilation warnings by building WinCairo port. > [121/1324] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\ThreadingWin.cpp.obj > ..\..\Source\WTF\wtf\ThreadingWin.cpp(326): warning C4312: 'type cast': conversion from 'unsigned int' to 'WTF::Thread *' of greater size > ..\..\Source\WTF\wtf\ThreadingWin.cpp(362): warning C4312: 'type cast': conversion from 'unsigned int' to 'WTF::Thread *' of greater size > ..\..\Source\WTF\wtf\ThreadingWin.cpp(365): warning C4312: 'type cast': conversion from 'unsigned int' to 'WTF::Thread *' of greater size > [223/1324] Building CXX object Source\JavaScriptCore\CMake...ces\JavaScriptCore\unified-sources\UnifiedSource76.cpp.obj > C:\webkit\ga\Source\JavaScriptCore\interpreter/StackVisitor.cpp(464): warning C4312: 'reinterpret_cast': conversion from 'unsigned int' to 'void *' of greater size > [244/1324] Building CXX object Source\JavaScriptCore\CMake...es\JavaScriptCore\unified-sources\UnifiedSource100.cpp.obj > c:\webkit\ga\source\javascriptcore\runtime\intlnumberformat.cpp(395) : warning C4701: potentially uninitialized local variable 'style' used MSDN: Rules for Using Pointers (Windows) https://msdn.microsoft.com/library/windows/desktop/aa384242 Created attachment 332641 [details]
Patch
Created attachment 332642 [details]
Patch
Comment on attachment 332642 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332642&action=review > Source/WTF/wtf/ThreadingWin.cpp:270 > +#define InvalidThread ((Thread*)(UINT_PTR)(0xbbadbeef)) I like `uintptr_t` even in Windows only code. And we prefer C++ casts. `reinterpret_cast<Thread*>(static_cast<uintptr_t>(0xbbadbeef))` is better. Comment on attachment 332642 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332642&action=review Thank you for the review. >> Source/WTF/wtf/ThreadingWin.cpp:270 >> +#define InvalidThread ((Thread*)(UINT_PTR)(0xbbadbeef)) > > I like `uintptr_t` even in Windows only code. And we prefer C++ casts. > `reinterpret_cast<Thread*>(static_cast<uintptr_t>(0xbbadbeef))` is better. Agreed. Created attachment 332730 [details]
Patch
Comment on attachment 332730 [details] Patch Clearing flags on attachment: 332730 Committed r227872: <https://trac.webkit.org/changeset/227872> All reviewed patches have been landed. Closing bug. |