Closed Bug 575014 Opened 14 years ago Closed 14 years ago

nsTArray::LastIndexOf triggers "warning C4244: 'return' : conversion from '__int64' to 'nsTArray_base::index_type', possible loss of data" on Win64

Categories

(Core :: XPCOM, defect)

x86_64
Windows NT
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

My FAIL_ON_WARNINGS lading in bug 557566 comment 28 triggered a build failure on 64-bit Windows, due to this warning:
> nsDocLoader.cpp
> e:\builds\moz2_slave\mozilla-central-win64-debug-nightly\build\obj-firefox\dist\include\nsTArray.h(416) : error C2220: warning treated as error - no 'object' file generated
[...]
> e:\builds\moz2_slave\mozilla-central-win64-debug-nightly\build\obj-firefox\dist\include\nsTArray.h(416) : warning C4244: 'return' : conversion from '__int64' to 'nsTArray_base::index_type', possible loss of data

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1277595343.1277596686.26568.gz

I'd run the patch through TryServer, but I guess TryServer doesn't do Win64 (nor does normal tinderbox actually, except to generate a few Win64 nightlies per day.)

Fix coming up.
I think this should fix it.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #454314 - Flags: review?(benjamin)
(Ultimately we might want to make nsTArray::index_type be size_t, but for now, the type-casting is a more conservative fix.)
Attachment #454314 - Flags: review?(benjamin) → review+
Landed patch with r=timeless and pending-review=bsmedberg, so that the bustage on Win64 nightlies will (hopefully) stop, and also since there's no other way for me to test this :-/  (No Win64 tryservers)

http://hg.mozilla.org/mozilla-central/rev/dc28988730e8
Nice, the next Win64 build (after this patch landed) was green:
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1277607223.1277613689.30944.gz
Resolving this as fixed -- had initially left this open with pending-r=bsmedberg, but timeless reviewed it, and it doesn't need another review.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: