C4267 and C4244 warnings During 64 bit build. (VS 2010)

333 views
Skip to first unread message

Taran

unread,
Feb 11, 2013, 9:49:01 AM2/11/13
to firebre...@googlegroups.com
Having successfully built a 32 bit Firebreath plugin, the client now wants a 64 bit version. I happily ran the prep2010x64 on the previous version that I'd created with, switched all the builds to 64 bit release and got the warnings that are typical of 64 bit porting.

Neither C4267 or C4244 are necessarily show stoppers, but they can be problematic if the sizes being converted from exceed those being converted to. I'm considering #pragma'ing them to remove the warnings but don't want to mess with the Firebreath code without seeing if anyone has found alternatives or has suggestions. I can modify the code to do casting as necessary and throw exceptions should there be an issue, but if there's a standard fix in place or in mind I'd like to take that route so that this project doesn't deviate from Firebreath standard practice. I searched and found nothing related to this in the group archives, so... tossing it out there. I imagine that others may have similar questions in the future.

Warnings are:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-

3>..\..\..\..\src\3rdParty\boost\libs\thread\src\win32\thread.cpp(224): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data

5>..\..\..\..\src\PluginAuto\Win\PluginWindowWin.cpp(78): warning C4244: 'argument' : conversion from 'LPARAM' to 'long', possible loss of data
5>..\..\..\..\src\PluginAuto\Win\PluginWindowWin.cpp(78): warning C4244: 'argument' : conversion from 'WPARAM' to 'uint32_t', possible loss of data

5>..\..\..\..\src\PluginAuto\Win\NpapiPluginWin.cpp(153): warning C4244: 'argument' : conversion from 'uintptr_t' to 'uint32_t', possible loss of data
7>..\..\src\NpapiCore\NpapiStream.cpp(43): warning C4267: '=' : conversion from 'size_t' to 'int32_t', possible loss of data
7>..\..\src\NpapiCore\NpapiStream.cpp(44): warning C4267: '=' : conversion from 'size_t' to 'uint32_t', possible loss of data
7>..\..\src\NpapiCore\NpapiStream.cpp(54): warning C4267: 'argument' : conversion from 'size_t' to 'int32_t', possible loss of data
7>..\..\src\NpapiCore\NpapiStream.cpp(90): warning C4267: 'return' : conversion from 'size_t' to 'int32_t', possible loss of data

4>..\..\src\PluginCore\SimpleStreamHelper.cpp(200): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
4>..\..\src\PluginCore\SimpleStreamHelper.cpp(201): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
4>..\..\src\PluginCore\SimpleStreamHelper.cpp(214): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data

5>..\..\src\activexcore\registrymap.hpp(44): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data

7>..\..\src\NpapiCore\NpapiPlugin.cpp(173): warning C4267: 'return' : conversion from 'size_t' to 'int32_t', possible loss of data

5>..\..\src\activexcore\registrymap.hpp(44): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
5>..\..\src\ActiveXCore\FBControl.h(552): warning C4244: 'argument' : conversion from 'LPARAM' to 'uint32_t', possible loss of data

7>c:\_projects\firebreath-firebreath-df8659e\src\npapicore\NPVariantUtil.h(95): warning C4267: 'argument' : conversion from 'size_t' to 'uint32_t', possible loss of data
7>..\..\src\npapicore\NPVariantUtil.h(99): warning C4267: '=' : conversion from 'size_t' to 'uint32_t', possible loss of data
7>..\..\src\npapicore\NPVariantUtil.h(112): warning C4267: 'argument' : conversion from 'size_t' to 'uint32_t', possible loss of data
7>..\..\src\npapicore\NPVariantUtil.h(116): warning C4267: '=' : conversion from 'size_t' to 'uint32_t', possible loss of data
7>..\..\src\NpapiCore\NpapiBrowserHost.cpp(745): warning C4267: 'argument' : conversion from 'size_t' to 'uint32_t', possible loss of data

7>..\..\src\NpapiCore\NPObjectAPI.cpp(305): warning C4267: 'argument' : conversion from 'size_t' to 'uint32_t', possible loss of data
7>..\..\src\NpapiCore\NPObjectAPI.cpp(307): warning C4267: 'argument' : conversion from 'size_t' to 'uint32_t', possible loss of data
7>..\..\src\NpapiCore\NPObjectAPI.cpp(416): warning C4267: 'argument' : conversion from 'size_t' to 'uint32_t', possible loss of data

7>..\..\src\NpapiCore\NPJavascriptObject.cpp(286): warning C4267: '=' : conversion from 'size_t' to 'uint32_t', possible loss of data

8>.\..\src\activexcore\registrymap.hpp(44): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data

8>..\..\src\ActiveXCore\IDispatchAPI.cpp(454): warning C4267: '=' : conversion from 'size_t' to 'UINT', possible loss of data
8>..\..\src\ActiveXCore\IDispatchAPI.cpp(501): warning C4267: '=' : conversion from 'size_t' to 'UINT', possible loss of data
8>..\..\src\ActiveXCore\IDispatchAPI.cpp(575): warning C4267: '=' : conversion from 'size_t' to 'UINT', possible loss of data
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-

Thoughts, comments, suggestions?

Taran

Taran

unread,
Feb 11, 2013, 4:26:52 PM2/11/13
to firebre...@googlegroups.com
I went through and eyeballed things and did some casting and '#pragma warning' as necessary. These things, of course, make the compiler warnings disappear - but the conservative programmer side of me is a bit uncomfortable with some of the things in there.

While talking to myself is a sign of impending mental disaster, I think I'm through the worst of it. :-)

Richard Bateman

unread,
Feb 11, 2013, 5:59:50 PM2/11/13
to firebre...@googlegroups.com

I know that others have used 64 bit plugins, but very few people really have a reason to do so, so I haven't spent any real time working on it.

You're welcome to fix all the warnings and submit a pull request =]

In actuality very few people have a good reason to do 64 bit; nobody uses 64 bit browsers by default on windows, only if they specifically switch to using it.

Richard

Taran

unread,
Feb 13, 2013, 11:40:22 AM2/13/13
to firebre...@googlegroups.com
Oh, I agree completely. What the client wants, the client gets. With lots of warnings.

That said, I'm exploring a few options for the client and if there's something useful that pops up, I'll wave it around. ;-)
Reply all
Reply to author
Forward
0 new messages