If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

RESOLVED FIXED

Status

()

Core
XPCOM
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
x86_64
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
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.
(Assignee)

Comment 1

7 years ago
Created attachment 454314 [details] [diff] [review]
fix: cast pointer-subtraction to be "index_type"

I think this should fix it.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #454314 - Flags: review?(benjamin)
(Assignee)

Comment 2

7 years ago
(Ultimately we might want to make nsTArray::index_type be size_t, but for now, the type-casting is a more conservative fix.)

Updated

7 years ago
Attachment #454314 - Flags: review?(benjamin) → review+
(Assignee)

Comment 3

7 years ago
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
(Assignee)

Comment 4

7 years ago
Nice, the next Win64 build (after this patch landed) was green:
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1277607223.1277613689.30944.gz
(Assignee)

Comment 5

7 years ago
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
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.