Last Comment Bug 643772 - dom/plugins can't compile on mingw due to implicit function pointer to void* casts
: dom/plugins can't compile on mingw due to implicit function pointer to void* ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: Trunk
: x86_64 Windows 7
: -- normal (vote)
: ---
Assigned To: Jacek Caban
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-22 09:10 PDT by Jacek Caban
Modified: 2011-05-02 04:29 PDT (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix v1.0 (3.23 KB, patch)
2011-03-22 09:10 PDT, Jacek Caban
no flags Details | Diff | Splinter Review
fix v1.1 (4.90 KB, patch)
2011-03-24 11:49 PDT, Jacek Caban
benjamin: review+
Details | Diff | Splinter Review
fix v2.0 (9.97 KB, patch)
2011-04-16 04:04 PDT, Jacek Caban
benjamin: review+
Details | Diff | Splinter Review

Description Jacek Caban 2011-03-22 09:10:41 PDT
Created attachment 520930 [details] [diff] [review]
fix v1.0

It's the same problem as bug 606846, discovered after enabling IPC
Comment 1 Jacek Caban 2011-03-24 11:49:32 PDT
Created attachment 521577 [details] [diff] [review]
fix v1.1

I've updated this patch to fix also win64 implementation (instead of filing separated bug). The problem is that cast from pointer to integer that loses precision is an error on GCC. The fix is to cast to uintptr_t instead and use implicit cast on its result. It's a similar problem to bug 611986
Comment 2 Benjamin Smedberg [:bsmedberg] 2011-04-13 13:13:30 PDT
Comment on attachment 521577 [details] [diff] [review]
fix v1.1

I would be happier if this were reinterpret_cast<void*>(value). r=me with that change
Comment 3 Jacek Caban 2011-04-16 04:04:58 PDT
Created attachment 526480 [details] [diff] [review]
fix v2.0

Thanks for review. reinterpret_cast is problematic, because GCC considers this case too illegal to allow it and reports an error. It's, however, possible to avoid even more casts if we change nsWindowsDllInterceptor.h to use intptr_t as an argument instead of void*. It's casted to intptr_t later anyway and on callers side, casts are still unavoidable, but reinterpret_cast works fine now.
Comment 4 Jacek Caban 2011-05-02 04:29:09 PDT
Thanks for the review.

http://hg.mozilla.org/mozilla-central/rev/24966d916555

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