Last Comment Bug 661517 - nsWebSocketHandler.cpp fails to compile on mingw-w64
: nsWebSocketHandler.cpp fails to compile on mingw-w64
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Networking: WebSockets (show other bugs)
: Trunk
: x86_64 Windows 7
: -- normal (vote)
: ---
Assigned To: Jacek Caban
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-02 06:31 PDT by Jacek Caban
Modified: 2011-06-06 04:21 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix v1.0 (982 bytes, patch)
2011-06-02 06:31 PDT, Jacek Caban
no flags Details | Diff | Splinter Review
fix using PRUptrdiff (996 bytes, patch)
2011-06-03 06:44 PDT, Jacek Caban
mcmanus: review+
Details | Diff | Splinter Review

Description Jacek Caban 2011-06-02 06:31:11 PDT
Created attachment 536870 [details] [diff] [review]
fix v1.0

mozilla-central/netwerk/protocol/websocket/nsWebSocketHandler.cpp:966:36: error: cast from 'PRUint8*' to 'long unsigned int' loses precision [-fpermissive]

That's because long is 32-bit on win64. In this case we don't care about losing precision, but it's still an error for GCC. The fix is as simple as using uintptr_t.
Comment 1 Olli Pettay [:smaug] 2011-06-02 10:19:51 PDT
Could you cast to some PRU*** type?
Comment 2 Olli Pettay [:smaug] 2011-06-03 05:02:48 PDT
Comment on attachment 536870 [details] [diff] [review]
fix v1.0

Or, uintptr_t could be ok, but this is Patrick's code
Comment 3 Jacek Caban 2011-06-03 06:44:15 PDT
Created attachment 537132 [details] [diff] [review]
fix using PRUptrdiff

The attached patch uses PRUptrdiff instead of uintptr_t. Please choose preferred version.
Comment 4 Patrick McManus [:mcmanus] 2011-06-03 06:58:06 PDT
Comment on attachment 536870 [details] [diff] [review]
fix v1.0

Review of attachment 536870 [details] [diff] [review]:
-----------------------------------------------------------------

Jacek, what do you think about using PRUptrdiff ?

There are a number of places in the code base (netwerk is not one of them) that go to some length to make sure uintptr_t is defined for old platforms.
Comment 5 Patrick McManus [:mcmanus] 2011-06-03 07:01:16 PDT
(In reply to comment #3)
> Created attachment 537132 [details] [diff] [review] [review]
> fix using PRUptrdiff
> 
> The attached patch uses PRUptrdiff instead of uintptr_t. Please choose
> preferred version.

heh - race condition.

good to go.
Comment 6 Jacek Caban 2011-06-06 04:21:06 PDT
Thanks for the review, pushed to m-c:

http://hg.mozilla.org/mozilla-central/rev/780fb17abc1e

Note You need to log in before you can comment on or make changes to this bug.