RESOLVED FIXED Bug 177007
[Win] Warning fix.
https://bugs.webkit.org/show_bug.cgi?id=177007
Summary [Win] Warning fix.
Per Arne Vollan
Reported 2017-09-15 09:07:08 PDT
On Win64, MSVC is currently giving a warning about conversion from signed to unsigned.
Attachments
Patch (3.17 KB, patch)
2018-01-30 02:27 PST, Fujii Hironori
no flags
Patch (3.95 KB, patch)
2018-01-30 02:36 PST, Fujii Hironori
no flags
Patch (3.98 KB, patch)
2018-01-30 17:17 PST, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2018-01-30 02:02:31 PST
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
Fujii Hironori
Comment 2 2018-01-30 02:27:32 PST
MSDN: Rules for Using Pointers (Windows) https://msdn.microsoft.com/library/windows/desktop/aa384242
Fujii Hironori
Comment 3 2018-01-30 02:27:53 PST
Fujii Hironori
Comment 4 2018-01-30 02:36:12 PST
Yusuke Suzuki
Comment 5 2018-01-30 02:57:41 PST
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.
Fujii Hironori
Comment 6 2018-01-30 17:14:53 PST
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.
Fujii Hironori
Comment 7 2018-01-30 17:17:40 PST
WebKit Commit Bot
Comment 8 2018-01-30 20:47:49 PST
Comment on attachment 332730 [details] Patch Clearing flags on attachment: 332730 Committed r227872: <https://trac.webkit.org/changeset/227872>
WebKit Commit Bot
Comment 9 2018-01-30 20:47:50 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2018-01-30 20:48:27 PST
Note You need to log in before you can comment on or make changes to this bug.