nsEventSource.cpp:1113:35: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]

RESOLVED FIXED in mozilla15

Status

()

Core
DOM: Events
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla15
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Filing bug on this build warning:
{
/mozilla/content/base/src/nsEventSource.cpp: In member function ‘nsresult nsEventSource::SetReconnectionTimeout()’:
/mozilla/content/base/src/nsEventSource.cpp:1113:35: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
}

for this assertion:
> 1113   NS_ASSERTION(mReconnectionTime >= 0, "mReconnectionTime lies");
where mReconnectionTime is unsigned (and has been ever since it & this assertion were introduced in bug 338583):
  http://hg.mozilla.org/mozilla-central/rev/a3903f835a81#l6.152
  http://hg.mozilla.org/mozilla-central/rev/a3903f835a81#l5.1027

Looks like the assertion can just go away.
(Assignee)

Comment 1

5 years ago
(this is a warning in GCC 4.6.3, FWIW - I think that's the first version of GCC to warn about this)
(Assignee)

Comment 2

5 years ago
Created attachment 618684 [details] [diff] [review]
fix
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #618684 - Flags: review?(bugs)
(Assignee)

Comment 3

5 years ago
Note: AFAICT, this value is read from an about:config pref, and then dynamically updated later on and clamped to the range [MIN_RECONNECTION_TIME_VALUE, MAX_RECONNECTION_TIME_VALUE]

So, it doesn't look like we're particularly worried about it underflowing or anything.

Updated

5 years ago
Attachment #618684 - Flags: review?(bugs) → review+
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/99e08b800458
Target Milestone: --- → mozilla15

Comment 5

5 years ago
https://hg.mozilla.org/mozilla-central/rev/99e08b800458
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.