Closed
Bug 1410622
Opened 7 years ago
Closed 7 years ago
TiledRegion.cpp : ccomparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-constant-compare]
Categories
(Core :: Graphics, defect, P3)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla58
People
(Reporter: Sylvestre, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file)
/data/jenkins/workspace/firefox-clang-last/gfx/src/TiledRegion.cpp:143:29: error: comparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-constant-compare]
return ((uint64_t)total > (uint64_t)SIZE_MAX) ? SIZE_MAX : (size_t)total;
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
Reporter | ||
Updated•7 years ago
|
Assignee: nobody → bpostelnicu
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8921026 -
Flags: review?(bugmail)
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8921026 [details]
Bug 1410622 - Prevent warning on 64bit systems when comparing uint64_t with size_t max value.
https://reviewboard.mozilla.org/r/191986/#review197238
::: gfx/src/TiledRegion.cpp:142
(Diff revision 1)
> int64_t tilesInLastRow = ((int64_t)mEnd.x - (int64_t)mTileBounds.x1) / kTileSize;
> int64_t tilesInFullRow = ((int64_t)mTileBounds.x2 - (int64_t)mTileBounds.x1) / kTileSize;
> int64_t total = tilesInFirstRow + (tilesInFullRow * numberOfFullRows) + tilesInLastRow;
> MOZ_ASSERT(total > 0);
> - // The total may be larger than what fits in a size_t, so clamp it to
> - // SIZE_MAX in that case.
> + // On 32bit systems the total may be larger than what fits in a size_t (4 bytes),
> + // so clamp it to SIZE_MAX in that case.
Update this comment so it says "size_t's max value" instead of SIZE_MAX since the code is no longer using SIZE_MAX.
Attachment #8921026 -
Flags: review?(bugmail) → review+
Comment hidden (mozreview-request) |
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7aa291217448
Prevent warning on 64bit systems when comparing uint64_t with size_t max value. r=kats
Updated•7 years ago
|
status-firefox56:
--- → wontfix
status-firefox57:
--- → wontfix
Priority: -- → P3
Whiteboard: [gfx-noted]
Comment 5•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Reporter | ||
Updated•7 years ago
|
Blocks: build-clang-trunk
Reporter | ||
Updated•7 years ago
|
No longer blocks: clang-based-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•