The default bug view has changed. See this FAQ.

nsHTMLEditRules.cpp:5810:52: warning: comparison between signed and unsigned integer expressions

VERIFIED FIXED in mozilla7

Status

()

Core
Editor
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: Ehsan)

Tracking

Trunk
mozilla7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Filing bug on this warning:
editor/libeditor/html/nsHTMLEditRules.cpp:5810:52: warning: comparison between signed and unsigned integer expressions

Flagged code is:
>   NS_ASSERTION(rangeCount == rangeItemArray.Length(), "How did that happen?");
where rangeCount is a signed int.

The contextual code already assumes it's non-negative[1], so it should be fine to just cast it to an unsigned value here.

[1] At this point in the code, we've just called  rangeItemArray.AppendElements(rangeCount), which would fail horribly if rangeCount were negative.
http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/nsHTMLEditRules.cpp#5806
(Assignee)

Comment 1

6 years ago
Created attachment 534119 [details] [diff] [review]
Patch (v1)
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #534119 - Flags: review?(roc)
Comment on attachment 534119 [details] [diff] [review]
Patch (v1)

Review of attachment 534119 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #534119 - Flags: review?(roc) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/3fa9d9b92de8
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Is this issue fixed?
Thanks.
(Reporter)

Comment 5

6 years ago
Yes. (link to patched chunk of source: http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/nsHTMLEditRules.cpp?mark=5848-5849#5848 )
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.