Closed
Bug 504025
Opened 15 years ago
Closed 15 years ago
[windows x64] casting pointer to long is illegal on win64
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.2b1
People
(Reporter: Mook, Assigned: Mook)
Details
Attachments
(3 files, 2 obsolete files)
769 bytes,
patch
|
dougt
:
review+
Biesinger
:
superreview+
|
Details | Diff | Splinter Review |
857 bytes,
patch
|
benjamin
:
review+
Biesinger
:
superreview+
|
Details | Diff | Splinter Review |
947 bytes,
patch
|
Mook
:
review+
|
Details | Diff | Splinter Review |
On 64 bit Windows, sizeof(long) is 32 bit and sizeof(void*) is 64 bits. (Yes, that's pretty ridiculous). When compiling this with GCC, trying to cast a void* to a long is a fatal error. Filing this bug as a generic catch-all for these casts
Component: Networking → General
QA Contact: networking → general
http://mxr.mozilla.org/mozilla-central/source/netwerk/base/src/nsRequestObserverProxy.cpp?rev=7239b015f833&mark=94,141#91 See comment 0 for rationale. (Sorry, I was originally going to file one bug per patch, but was told a catch-all bug was better; hence the component was initially set to networking.)
Attachment #388416 -
Flags: review?(cbiesinger)
http://mxr.mozilla.org/mozilla-central/source/netwerk/base/src/nsAutodialWin.cpp?rev=7239b015f833&mark=691,740#688 This one's actually casting a HANDLE to a UINT, but it's another "don't cast void* to long" patch :)
Attachment #388417 -
Flags: review?
Attachment #388417 -
Flags: review? → review?(doug.turner)
http://mxr.mozilla.org/mozilla-central/source/uriloader/exthandler/win/nsMIMEInfoWin.cpp?rev=7239b015f833&mark=149,329#146 See comment 0 for details; hInstaApp is a HINST(void* sized) and can't be cast to an int, it needs to be cast to something pointer-sized. LONG_PTR is that on Windows. (I'm not sure who to pick for r? on this one, given that it's windows-only code and none of the peers listed seem particularly windows-oriented...)
Attachment #388418 -
Flags: review?(benjamin)
Comment 4•15 years ago
|
||
Comment on attachment 388416 [details] [diff] [review] network: nsRequestObserverProxy.cpp - don't cast to long just use %p and remove the cast
Attachment #388416 -
Flags: review?(cbiesinger) → review-
Comment 5•15 years ago
|
||
Comment on attachment 388418 [details] [diff] [review] cast HINST to LONG_PTR instead of int for comparison with 32 [Checkin: Comment 12] I thought I was a peer for this one, but apparently not :)
Attachment #388418 -
Flags: superreview+
Updated•15 years ago
|
Attachment #388417 -
Flags: superreview+
Updated•15 years ago
|
Attachment #388417 -
Flags: review?(doug.turner) → review+
Thanks for the fast review! Also, didn't know NSPR's printf supported %p - too used to the intersection of (gcc, msvc) :)
Attachment #388416 -
Attachment is obsolete: true
Attachment #388423 -
Flags: review?(cbiesinger)
Comment 7•15 years ago
|
||
Comment on attachment 388423 [details] [diff] [review] use %p instead of casts can you add a space after the comma? both gcc and msvc support %p, right?
Attachment #388423 -
Flags: review?(cbiesinger) → review+
carrying forward r+ from bug 388423 ... and yes, msvc does have %p. I _think_ I'll get things right eventually. Sigh.
Attachment #388423 -
Attachment is obsolete: true
Attachment #388425 -
Flags: review+
Updated•15 years ago
|
Attachment #388418 -
Flags: review?(benjamin) → review+
Keywords: checkin-needed
Which patches need checkin here? All of the non-obsolete ones?
Assignee | ||
Comment 10•15 years ago
|
||
(In reply to comment #9) > Which patches need checkin here? All of the non-obsolete ones? I think so, yes - nothing here touches any interfaces, so by the new rules nothing should need sr. They also all happen to be trivial patches (<1k each) :)
Comment 11•15 years ago
|
||
Comment on attachment 388417 [details] [diff] [review] don't cast HANDLE to UINT either [Checkin: Comment 11] http://hg.mozilla.org/mozilla-central/rev/29dd8a03ef7d
Attachment #388417 -
Attachment description: don't cast HANDLE to UINT either → don't cast HANDLE to UINT either
[Checkin: Comment 11]
Comment 12•15 years ago
|
||
Comment on attachment 388418 [details] [diff] [review] cast HINST to LONG_PTR instead of int for comparison with 32 [Checkin: Comment 12] http://hg.mozilla.org/mozilla-central/rev/2311880a8e6a
Attachment #388418 -
Attachment description: cast HINST to LONG_PTR instead of int for comparison with 32 → cast HINST to LONG_PTR instead of int for comparison with 32
[Checkin: Comment 12]
Comment 13•15 years ago
|
||
Comment on attachment 388425 [details] [diff] [review] add spaces [Checkin: Comment 13] http://hg.mozilla.org/mozilla-central/rev/7a25fbd9ab9f
Attachment #388425 -
Attachment description: add spaces → add spaces
[Checkin: Comment 13]
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2b1
You need to log in
before you can comment on or make changes to this bug.
Description
•