Closed Bug 749229 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: DOM: Events, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.
(this is a warning in GCC 4.6.3, FWIW - I think that's the first version of GCC to warn about this)
Attached patch fixSplinter Review
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #618684 - Flags: review?(bugs)
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.
Attachment #618684 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/99e08b800458
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.