Bug 19824

Summary: javascriptcore\kjs\JSImmediate.h generates MSVC compiler warning.
Product: WebKit Reporter: Paul Pedriana <ppedriana>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: ap
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   

Paul Pedriana
Reported 2008-06-30 02:17:49 PDT
javascriptcore\kjs\JSImmediate.h has the following code: static bool isNegative(const JSValue* v) { ASSERT(isNumber(v)); return reinterpret_cast<uintptr_t>(v) & 0x80000000; } which generates the following warning under MSVC: JSImmediate.h(88) : warning C4800: 'uintptr_t' : forcing value to bool 'true' or 'false' (performance warning) A simple workaround which results in identical behavior is to use the following: static bool isNegative(const JSValue* v) { ASSERT(isNumber(v)); return (reinterpret_cast<uintptr_t>(v) & 0x80000000) != 0; } That this function appears to not work on 64 bit is another issue.
Attachments
Alexey Proskuryakov
Comment 1 2008-06-30 08:09:03 PDT
At some point, we did try to appease MSVC in this regard, but then decided to stop wasting time on it, given that this warning makes no sense really, and modifications made on the Mac kept breaking Windows build. See WebKitLibraries/win/tools/vsprops/common.vsprops for the full list of warnings that we disable. > That this function appears to not work on 64 bit is another issue. That will be a serious issue if it doesn't work.
Note You need to log in before you can comment on or make changes to this bug.