Summary: | [Win] Lots of compiler warnings on Windows | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | bfulgham, fpizlo, ggaren, mark.lam, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Brent Fulgham
2014-07-23 11:57:10 PDT
Created attachment 239361 [details]
the patch.
Comment on attachment 239361 [details] the patch. View in context: https://bugs.webkit.org/attachment.cgi?id=239361&action=review r=me > Source/JavaScriptCore/dfg/DFGArgumentPosition.h:67 > + return checkAndSet(m_shouldNeverUnbox, m_shouldNeverUnbox || shouldNeverUnbox); Why is this needed? Comment on attachment 239361 [details] the patch. View in context: https://bugs.webkit.org/attachment.cgi?id=239361&action=review >> Source/JavaScriptCore/dfg/DFGArgumentPosition.h:67 >> + return checkAndSet(m_shouldNeverUnbox, m_shouldNeverUnbox || shouldNeverUnbox); > > Why is this needed? Windows MSVC does not like bitwise ORing booleans. That's what it was warning about, and flooding the build output with warning messages. Comment on attachment 239361 [details] the patch. View in context: https://bugs.webkit.org/attachment.cgi?id=239361&action=review >>> Source/JavaScriptCore/dfg/DFGArgumentPosition.h:67 >>> + return checkAndSet(m_shouldNeverUnbox, m_shouldNeverUnbox || shouldNeverUnbox); >> >> Why is this needed? > > Windows MSVC does not like bitwise ORing booleans. That's what it was warning about, and flooding the build output with warning messages. To be accurate, the checkAndSet() template function compares the 2 arguments. Using a bitwise OR results in the second argument becoming type int. MSVC did not like a comparing a bool (first argument) to an int (second arg) in the reification of the template code. Thanks. Landed in r174371: <http://trac.webkit.org/r174371>. > To be accurate, the checkAndSet() template function compares the 2 arguments. Using a bitwise OR results in the second argument becoming type int. MSVC did not like a comparing a bool (first argument) to an int (second arg) in the reification of the template code.
A slightly better option here is probably to static_cast the result to bool. The original programmer did not intend for this code to include a branch, and the build fix introduced a logical branch. (Hopefully, the compiler will eliminate the logical branch, but still, it's nice for build fixes to honor the original programmer's intention.)
*** Bug 125122 has been marked as a duplicate of this bug. *** |