| Summary: | Blob.cpp fails to build with some gcc versions because of signed/unsigned comparison | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Praveen Jadhav <praveen.j> | ||||||
| Component: | WebKit EFL | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | ap, commit-queue, lucas.de.marchi, oliver, tanay.c | ||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Praveen Jadhav
2014-05-08 02:30:04 PDT
Created attachment 231056 [details]
Patch
Comment on attachment 231056 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=231056&action=review Sorry for the breakage - efl-wk2 bot was green, and efl one does not work. > Source/WebCore/fileapi/Blob.cpp:127 > - m_size = (actualSize <= std::numeric_limits<long long>::max()) ? static_cast<long long>(actualSize) : 0; > + m_size = (actualSize <= std::numeric_limits<unsigned long long>::max()) ? static_cast<long long>(actualSize) : 0; The purpose of this check is to verify that the number fits into long long - we already know that it fits into an unsigned long long! if it complains about signed/unsigned comparison, you probably need something like actualSize <= static_cast<unsigned long long>(std::numeric_limits<long long>::max())) Well, its strange that no one else got this error(efl buildbot is successful). I am not sure if this is because of some mismatch in my PC. Will try to resolve this locally. Thanks! *** Bug 132947 has been marked as a duplicate of this bug. *** As mentioned in duplicate, perhaps we have an existing less wordy solution for this? Perhaps something in CheckedArithmetic.h? Seems like isInBounds<long long>(actualSize) should do the trick. Created attachment 231560 [details]
Patch
(In reply to comment #6) > Seems like isInBounds<long long>(actualSize) should do the trick. Yes it fixes the build issue. Uploaded a patch with changes. Comment on attachment 231560 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=231560&action=review > Source/WebCore/fileapi/Blob.cpp:127 > + m_size = (WTF::isInBounds<long long>(actualSize)) ? static_cast<long long>(actualSize) : 0; Does it compile without "WTF::"? Please remove the prefix when landing if it does. (In reply to comment #9) > (From update of attachment 231560 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=231560&action=review > > > Source/WebCore/fileapi/Blob.cpp:127 > > + m_size = (WTF::isInBounds<long long>(actualSize)) ? static_cast<long long>(actualSize) : 0; > > Does it compile without "WTF::"? Please remove the prefix when landing if it does. Without 'WTF::' compiler is not able to resolve the function. We should retain it. Comment on attachment 231560 [details] Patch Clearing flags on attachment: 231560 Committed r169329: <http://trac.webkit.org/changeset/169329> All reviewed patches have been landed. Closing bug. |