[webkit-reviews] review denied: [Bug 101458] Fix compile warning [-Wsign-compare] : [Attachment 172777] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Nov 7 09:44:10 PST 2012
Alexey Proskuryakov <ap at webkit.org> has denied review:
Bug 101458: Fix compile warning [-Wsign-compare]
https://bugs.webkit.org/show_bug.cgi?id=101458
Attachment 172777: Patch
https://bugs.webkit.org/attachment.cgi?id=172777&action=review
------- Additional Comments from Alexey Proskuryakov <ap at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=172777&action=review
This change at least needs a detailed explanation, but is likely incorrect.
> Source/WebCore/ChangeLog:8
> + Fix compile warning by using early return when file size is less
than or equal to zero.
How can file size be less than zero?
> Source/WebCore/platform/posix/SharedBufferPOSIX.cpp:54
> - size_t bytesToRead = fileStat.st_size;
> - if (bytesToRead != fileStat.st_size) {
> + if (fileStat.st_size <= 0) {
I'm not exactly sure what this check was meant for. It looks like it's meant to
take care of platforms where st_size type is wider than size_t, so such
conversion is lossy. Proposed code doesn't handle that.
More information about the webkit-reviews
mailing list