Closed Bug 868673 Opened 7 years ago Closed 7 years ago

Fix -Wtype-limits "comparison of unsigned expression >= 0 is always true" warning in XPFE

Categories

(Core :: XUL, defect, P3, trivial)

defect

Tracking

()

RESOLVED FIXED
mozilla23
Tracking Status
firefox22 --- wontfix
firefox23 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

Details

Attachments

(1 file)

When compiling with gcc 4.7 for Android, I get the following warning in XPFE code because `zLevel` is unsigned and `lowestZ` is a 0 constant. ToInteger() returns a signed int, so I changed `zLevel` to be signed, too.

xpfe/appshell/src/nsXULWindow.cpp: In member function 'bool nsXULWindow::LoadMiscPersistentAttributesFromXUL()':
xpfe/appshell/src/nsXULWindow.cpp:1249:46: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
Attachment #745435 - Flags: review?(neil)
Comment on attachment 745435 [details] [diff] [review]
fix-type-limit-warning.patch

ToInteger returns an int32_t, so this makes sense. Otherwise you have to start fiddling around with asserting that lowestZ is zero, which isn't worth it.
Attachment #745435 - Flags: review?(neil) → review+
https://hg.mozilla.org/mozilla-central/rev/03b869365923
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Moving to Core:XUL per https://bugzilla.mozilla.org/show_bug.cgi?id=1455336
Component: XP Toolkit/Widgets: XUL → XUL
You need to log in before you can comment on or make changes to this bug.