Last Comment Bug 781545 - Fix PluginInstanceParent.cpp build with GCC 4.6
: Fix PluginInstanceParent.cpp build with GCC 4.6
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla17
Assigned To: Benoit Jacob [:bjacob] (mostly away)
: Benjamin Smedberg [:bsmedberg]
Depends on:
Blocks: 743573
  Show dependency treegraph
Reported: 2012-08-09 08:30 PDT by Benoit Jacob [:bjacob] (mostly away)
Modified: 2012-08-09 15:00 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

fix the build (1.00 KB, patch)
2012-08-09 08:30 PDT, Benoit Jacob [:bjacob] (mostly away)
benjamin: review+
Details | Diff | Splinter Review

Description Benoit Jacob [:bjacob] (mostly away) 2012-08-09 08:30:18 PDT
Created attachment 650573 [details] [diff] [review]
fix the build

On Ubuntu 12.04, gcc 4.6.3, I get this build error:

/hack/mozilla-central/dom/plugins/ipc/PluginInstanceParent.cpp: In member function ‘virtual bool mozilla::plugins::PluginInstanceParent::AnswerNPN_SetValue_NPPVpluginDrawingModel(const int&, mozilla::plugins::PPluginInstanceParent::OptionalShmem*, mozilla::plugins::PPluginInstanceParent::CrossProcessMutexHandle*, NPError*)’:
/hack/mozilla-central/dom/plugins/ipc/PluginInstanceParent.cpp:453:46: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1plus: all warnings being treated as errors

WARNINGS_AS_ERRORS has been enabled there by bug 743573.

The code here sucks: there is no valid use case for converting integers of smaller sizes to pointers. If a universal untyped storage of the size of a pointer is wanted, void* is not the right type to use for that. uintptr_t would be it.

hg annotate is unable to find the author of this code, as it hits a big merge first, 17c65d32c7b891e70435561b965b71c355bd28ac, by BenWa. CC'ing.
Comment 1 Benjamin Smedberg [:bsmedberg] 2012-08-09 08:40:13 PDT
Comment on attachment 650573 [details] [diff] [review]
fix the build

I don't understand the second paragraph of your rant; we're dealing with a frozen NPAPI call here which specifies a void* and then sometimes passes numbers through it. We should just make the cast and not fret.
Comment 2 Benoit Jacob [:bjacob] (mostly away) 2012-08-09 08:42:23 PDT
If the NPAPI interface requires that void*, I shall direct my ranting against NPAPI instead of the author of this code.
Comment 3 Benoit Jacob [:bjacob] (mostly away) 2012-08-09 08:45:38 PDT
Comment 4 Benoit Jacob [:bjacob] (mostly away) 2012-08-09 09:01:36 PDT

backed out from inbound because Ms2ger landed a fix on m-c.

*** This bug has been marked as a duplicate of bug 781058 ***
Comment 5 Benoit Jacob [:bjacob] (mostly away) 2012-08-09 09:07:25 PDT
hah! That was a _different_ occurence in the same file. Re-landed.
Comment 6 Benoit Jacob [:bjacob] (mostly away) 2012-08-09 09:09:14 PDT
*** Bug 781058 has been marked as a duplicate of this bug. ***
Comment 7 Ryan VanderMeulen [:RyanVM] 2012-08-09 15:00:52 PDT

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