Closed Bug 1125690 Opened 5 years ago Closed 5 years ago

Fix -Wtautological-compare warning in toolkit/mozapps/update/updater and mark FAIL_ON_WARNINGS

Categories

(Toolkit :: Application Update, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

clang warns (-Wtautological-compare) that copy_recursive_skiplist::find()'s for loop compares an unsigned index i with N (i.e. SKIPLIST_COUNT) which is 0 #ifdef XP_MACOSX and thus the for loop condition is never true. This patch changes find()'s index variable i to a signed int.

However, clang then warns (-Wsign-compare) about comparing signed index i to an unsigned N. This patch casts unsigned N to signed int for the comparison.

Green Try build:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=ae465d9f9631
Attachment #8554339 - Flags: review?(robert.strong.bugs)
Depends on: FAIL_ON_WARNINGS
Attachment #8554339 - Flags: review?(robert.strong.bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/8eec3d8ec60a
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.