Closed
Bug 781058
Opened 12 years ago
Closed 12 years ago
Fix -Werror=int-to-pointer-cast in dom/
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: dholbert, Assigned: Ms2ger)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
4.42 KB,
patch
|
mounir
:
review+
|
Details | Diff | Splinter Review |
947 bytes,
patch
|
mounir
:
review+
|
Details | Diff | Splinter Review |
1.06 KB,
patch
|
mounir
:
review+
|
Details | Diff | Splinter Review |
Bug 743573 annotated dom/base/Makefile.in with FAIL_ON_WARNINGS, and there's at least one warning in that directory that's now killing my build (with --enable-warnings-as-errors): { dom/base/nsDOMClassInfo.cpp: In function ‘void* FlagsToPrivate(PRUint32)’: dom/base/nsDOMClassInfo.cpp:9069:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] } I'm using GCC 4.7 (though IIRC that warning exists in GCC 4.6 as well, and I'd guess we have a decent number of developers using GCC 4.6)
Reporter | ||
Comment 1•12 years ago
|
||
This warning is for this line: https://hg.mozilla.org/mozilla-central/rev/9c869e64ee26#l18.2267 from Bug 549143. > return (void *)(flags << 1); (where flags is a PRUint32)
Blocks: fatvals
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → Ms2ger
Summary: nsDOMClassInfo.cpp:9069:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] → Fix -Werror=int-to-pointer-cast in dom/
Assignee | ||
Comment 2•12 years ago
|
||
We try to stick an XID into the void* window in NPWindow; this patch keeps the conversion in dedicated functions.
Attachment #650015 -
Flags: review?(mounir)
Assignee | ||
Comment 3•12 years ago
|
||
setvalue is a horrible API
Attachment #650016 -
Flags: review?(mounir)
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #650018 -
Flags: review?(mounir)
Reporter | ||
Comment 5•12 years ago
|
||
(At some point, I think uintptr_t wasn't supported by MSVC -- does it compile there now?)
Comment 6•12 years ago
|
||
Comment on attachment 650015 [details] [diff] [review] Part a: nsPluginNativeWindowGtk2 Review of attachment 650015 [details] [diff] [review]: ----------------------------------------------------------------- r=me if you check if static_cast<> is usable instead of reinterpret_cast<>. ::: dom/plugins/base/nsPluginNativeWindowGtk2.cpp @@ +29,5 @@ > virtual nsresult CallSetWindow(nsRefPtr<nsNPAPIPluginInstance> &aPluginInstance); > private: > + void SetWindow(XID aWindow) > + { > + window = reinterpret_cast<void*>(static_cast<uintptr_t>(aWindow)); I wonder why reinterpret_cast<> instead of static_cast<>... Could you confirm static_cast<> doesn't work here?
Attachment #650015 -
Flags: review?(mounir) → review+
Comment 7•12 years ago
|
||
Comment on attachment 650016 [details] [diff] [review] Part b: PluginInstanceParent Review of attachment 650016 [details] [diff] [review]: ----------------------------------------------------------------- Same thing for reinterpret_cast<>/static_cast<>.
Attachment #650016 -
Flags: review?(mounir) → review+
Updated•12 years ago
|
Attachment #650018 -
Flags: review?(mounir) → review+
Assignee | ||
Comment 8•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8759d59636f0 https://hg.mozilla.org/mozilla-central/rev/2a19a83e94c8 https://hg.mozilla.org/mozilla-central/rev/3199bc043da4
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Reporter | ||
Comment 10•12 years ago
|
||
Patch b here didn't finish off PluginInstanceParent.cpp -- a very-similar chunk of code -- with "(void*)drawingModel" -- also appears at line 453 (50 lines after the chunk touched by patch b), and that chunk triggers the same warning/error.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 11•12 years ago
|
||
Yep, that's what I ran into in bug 781545. Landed on inbound.
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → DUPLICATE
Reporter | ||
Comment 12•12 years ago
|
||
Yup, just caught that. Thanks! (Re-resolving as FIXED rather than dupe, since this bug and bug 781545 both had patches land, to fix different (but related) things, and it feels icky to have had patches land on a bug that's marked as a duplicate.)
Resolution: DUPLICATE → FIXED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•