dom/plugins can't compile on mingw due to implicit function pointer to void* casts

RESOLVED FIXED

Status

()

Core
Plug-ins
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: Jacek Caban, Assigned: Jacek Caban)

Tracking

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

7 years ago
Created attachment 520930 [details] [diff] [review]
fix v1.0

It's the same problem as bug 606846, discovered after enabling IPC
Attachment #520930 - Flags: review?(benjamin)
(Assignee)

Comment 1

7 years ago
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
Attachment #520930 - Attachment is obsolete: true
Attachment #520930 - Flags: review?(benjamin)
Attachment #521577 - Flags: review?(benjamin)
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
Attachment #521577 - Flags: review?(benjamin) → review+
(Assignee)

Comment 3

6 years ago
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.
Attachment #526480 - Flags: review?(benjamin)
Attachment #526480 - Flags: review?(benjamin) → review+
(Assignee)

Comment 4

6 years ago
Thanks for the review.

http://hg.mozilla.org/mozilla-central/rev/24966d916555
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.