Summary: | -Wsign-compare warnings in FTLLowerDFGToB3.cpp and DFGSpeculativeJIT.cpp | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> | ||||
Component: | JavaScriptCore | Assignee: | Michael Catanzaro <mcatanzaro> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | darin, ews-watchlist, keith_miller, mark.lam, mcatanzaro, msaboff, saam, tzagallo, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=206182 | ||||||
Attachments: |
|
Description
Michael Catanzaro
2020-05-12 09:22:20 PDT
Created attachment 399134 [details]
Patch
Comment on attachment 399134 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399134&action=review > Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3600 > + static_assert(JSValue::BigInt32Mask == static_cast<int64_t>(0xfffe000000000012)); Would using a "ll" suffix suffice? 0xfffe000000000012ll > Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:3346 > + static_assert(JSValue::BigInt32Mask == static_cast<int64_t>(0xfffe000000000012)); Ditto. Comment on attachment 399134 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399134&action=review r=me because I don’t see a better solution >> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3600 >> + static_assert(JSValue::BigInt32Mask == static_cast<int64_t>(0xfffe000000000012)); > > Would using a "ll" suffix suffice? 0xfffe000000000012ll I think that won’t work because the value doesn’t fit in a 64-bit long long, and so the language makes it unsigned long long in that case. I consulted https://en.cppreference.com/w/cpp/language/integer_literal to explore this. Committed r261564: <https://trac.webkit.org/changeset/261564> All reviewed patches have been landed. Closing bug and clearing flags on attachment 399134 [details]. (In reply to Darin Adler from comment #3) > I think that won’t work because the value doesn’t fit in a 64-bit long long, > and so the language makes it unsigned long long in that case. I consulted > https://en.cppreference.com/w/cpp/language/integer_literal to explore this. Exactly. I had consulted the same page to figure out how integer literals work. Learning is good! |