WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
132678
Blob.cpp fails to build with some gcc versions because of signed/unsigned comparison
https://bugs.webkit.org/show_bug.cgi?id=132678
Summary
Blob.cpp fails to build with some gcc versions because of signed/unsigned com...
Praveen Jadhav
Reported
2014-05-08 02:30:04 PDT
WebKit build fails for EFL port with below error /home/praveen.j/WebKit/Source/WebCore/fileapi/Blob.cpp: In member function ‘long long unsigned int WebCore::Blob::size() const’: /home/praveen.j/WebKit/Source/WebCore/fileapi/Blob.cpp:127:69: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] cc1plus: all warnings being treated as errors make[2]: *** [Source/WebCore/CMakeFiles/WebCore.dir/fileapi/Blob.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [Source/WebCore/CMakeFiles/WebCore.dir/all] Error 2 make: *** [all] Error 2
Attachments
Patch
(1.54 KB, patch)
2014-05-08 02:38 PDT
,
Praveen Jadhav
ap
: review-
ap
: commit-queue-
Details
Formatted Diff
Diff
Patch
(1.47 KB, patch)
2014-05-15 23:39 PDT
,
Tanay
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Praveen Jadhav
Comment 1
2014-05-08 02:38:16 PDT
Created
attachment 231056
[details]
Patch
Alexey Proskuryakov
Comment 2
2014-05-08 09:30:20 PDT
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()))
Praveen Jadhav
Comment 3
2014-05-09 03:52:44 PDT
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!
Alexey Proskuryakov
Comment 4
2014-05-15 09:31:19 PDT
***
Bug 132947
has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 5
2014-05-15 09:33:19 PDT
As mentioned in duplicate, perhaps we have an existing less wordy solution for this? Perhaps something in CheckedArithmetic.h?
Alexey Proskuryakov
Comment 6
2014-05-15 09:51:20 PDT
Seems like isInBounds<long long>(actualSize) should do the trick.
Tanay
Comment 7
2014-05-15 23:39:07 PDT
Created
attachment 231560
[details]
Patch
Tanay
Comment 8
2014-05-15 23:41:10 PDT
(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.
Alexey Proskuryakov
Comment 9
2014-05-16 09:33:06 PDT
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.
Tanay
Comment 10
2014-05-18 19:51:29 PDT
(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.
WebKit Commit Bot
Comment 11
2014-05-26 00:15:40 PDT
Comment on
attachment 231560
[details]
Patch Clearing flags on attachment: 231560 Committed
r169329
: <
http://trac.webkit.org/changeset/169329
>
WebKit Commit Bot
Comment 12
2014-05-26 00:15:46 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug