nsScriptLoader.cpp:1286:50: warning: comparison of unsigned expression >= 0 is always true

RESOLVED FIXED in mozilla14

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla14
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Filing bug on this build warning:
nsScriptLoader.cpp: In member function ‘nsresult nsScriptLoader::PrepareLoadedRequest(nsScriptLoadRequest*, nsIStreamLoader*, nsresult, PRUint32, const PRUint8*)’:
nsScriptLoader.cpp:1286:50: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
nsScriptLoader.cpp:1286:91: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
nsScriptLoader.cpp:1286:157: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
nsScriptLoader.cpp:1286:197: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]

This is for this chunk:
1286   NS_ASSERTION(mDeferRequests.IndexOf(aRequest) >= 0 ||
1287                mAsyncRequests.IndexOf(aRequest) >= 0 ||
1288                mNonAsyncExternalScriptInsertedRequests.IndexOf(aRequest) >= 0 ||
1289                mXSLTRequests.IndexOf(aRequest) >= 0 ||
1290                mPreloads.Contains(aRequest, PreloadRequestComparator()) ||
1291                mParserBlockingRequest,
1292                "aRequest should be pending!");

Those IndexOf functions all return unsigned values now, as of this change:
http://hg.mozilla.org/mozilla-central/diff/aacd84d91b66/content/base/src/nsScriptLoader.h
which switched those arrays from nsCOMArray (which returns a signed value from IndexOf) to nsTArray (which returns an unsigned value from IndexOf)

I think we need to change these IndexOf() calls to Contain() calls.
(Assignee)

Comment 1

5 years ago
Created attachment 607864 [details] [diff] [review]
fix v1
Attachment #607864 - Flags: review?(hsivonen)
Attachment #607864 - Flags: review?(hsivonen) → review+
(Assignee)

Updated

5 years ago
Whiteboard: [autoland-try]
(Assignee)

Updated

5 years ago
OS: Linux → All
Hardware: x86_64 → All

Updated

5 years ago
Whiteboard: [autoland-try] → [autoland-in-queue]

Comment 2

5 years ago
Autoland Patchset:
	Patches: 607864
	Branch: mozilla-central => try
	Destination: http://hg.mozilla.org/try/pushloghtml?changeset=2c6b4f398985
Try run started, revision 2c6b4f398985. To cancel or monitor the job, see: https://tbpl.mozilla.org/?tree=Try&rev=2c6b4f398985
(Assignee)

Comment 3

5 years ago
Darn, looks like [autoland-try] just triggers builds & no tests.  I wanted to give this a unittest sanity-check, since this effectively re-enables an assertion that's been nerfed for a little while, and it's possible that we've since added a testcase (or some code) that fails the non-nerfed assertion.

I just pushed to try manually, so as not to confuse autoland with another request while it's waiting for the first run's results:
   https://tbpl.mozilla.org/?tree=Try&rev=160eaa422e12
(In reply to Daniel Holbert [:dholbert] from comment #3)
> Darn, looks like [autoland-try] just triggers builds & no tests.

FWIW, you can instruct it to trigger tests with normal try syntax:

[autoland-try:-b do -p all -u all -t none]
(Assignee)

Comment 5

5 years ago
Yup, I know -- I'd just mistakenly assumed that [autoland-try] would trigger all unit tests (instead of no unit tests).
Ah, yeah, it used to and then the behavior flipped a couple of weeks ago.

Comment 7

5 years ago
Try run for 2c6b4f398985 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=2c6b4f398985
Results (out of 14 total builds):
    success: 14
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/autolanduser@mozilla.com-2c6b4f398985

Updated

5 years ago
Whiteboard: [autoland-in-queue]
(Assignee)

Comment 8

5 years ago
Landed:
 https://hg.mozilla.org/integration/mozilla-inbound/rev/377a8d6327aa
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/377a8d6327aa
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.