Page 1 of 1

VS2012 Compile Warnings

Posted: Sun Feb 08, 2015 3:33 pm
by John Adams
VS2012 started displaying this cryptic warning a while back and I never looked into it until now. Can anyone tell me what exact line of code is causing this? I do not seem to see it in the warning spew:

Code: Select all

1>------ Build started: Project: WorldServer, Configuration: Debug Win32 ------1>  Commands.cpp1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\utility(182): warning C4244: 'initializing' : conversion from 'double' to 'const float', possible loss of data1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0(617) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2>::pair<double,std::shared_ptr<_Ty>>(std::pair<double,_Ty2> &&,void **)' being compiled1>          with1>          [1>              _Ty1=const float,1>              _Ty2=std::shared_ptr<Npc>,1>              _Ty=Npc1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0(617) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2>::pair<double,std::shared_ptr<_Ty>>(std::pair<double,_Ty2> &&,void **)' being compiled1>          with1>          [1>              _Ty1=const float,1>              _Ty2=std::shared_ptr<Npc>,1>              _Ty=Npc1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0(751) : see reference to function template instantiation 'void std::allocator<_Ty>::construct<_Objty,std::pair<_Ty1,_Ty2>>(_Objty *,_V0_t &&)' being compiled1>          with1>          [1>              _Ty=std::_Tree_node<std::pair<const float,std::shared_ptr<Npc>>,void *>,1>              _Objty=std::pair<const float,std::shared_ptr<Npc>>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _V0_t=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0(751) : see reference to function template instantiation 'void std::allocator<_Ty>::construct<_Objty,std::pair<_Ty1,_Ty2>>(_Objty *,_V0_t &&)' being compiled1>          with1>          [1>              _Ty=std::_Tree_node<std::pair<const float,std::shared_ptr<Npc>>,void *>,1>              _Objty=std::pair<const float,std::shared_ptr<Npc>>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _V0_t=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0(903) : see reference to function template instantiation 'void std::allocator_traits<_Alloc>::construct<_Ty,std::pair<_Ty1,_Ty2>>(std::allocator<_Other> &,_Objty *,_V0_t &&)' being compiled1>          with1>          [1>              _Alloc=std::allocator<std::_Tree_node<std::pair<const float,std::shared_ptr<Npc>>,void *>>,1>              _Ty=std::pair<const float,std::shared_ptr<Npc>>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _Other=std::_Tree_node<std::pair<const float,std::shared_ptr<Npc>>,void *>,1>              _Objty=std::pair<const float,std::shared_ptr<Npc>>,1>              _V0_t=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0(903) : see reference to function template instantiation 'void std::allocator_traits<_Alloc>::construct<_Ty,std::pair<_Ty1,_Ty2>>(std::allocator<_Other> &,_Objty *,_V0_t &&)' being compiled1>          with1>          [1>              _Alloc=std::allocator<std::_Tree_node<std::pair<const float,std::shared_ptr<Npc>>,void *>>,1>              _Ty=std::pair<const float,std::shared_ptr<Npc>>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _Other=std::_Tree_node<std::pair<const float,std::shared_ptr<Npc>>,void *>,1>              _Objty=std::pair<const float,std::shared_ptr<Npc>>,1>              _V0_t=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xtree(945) : see reference to function template instantiation 'void std::_Wrap_alloc<_Alloc>::construct<_Ty,std::pair<_Ty1,_Ty2>>(_Ty *,_V0_t &&)' being compiled1>          with1>          [1>              _Alloc=std::allocator<std::_Tree_node<std::pair<const float,std::shared_ptr<Npc>>,void *>>,1>              _Ty=std::pair<const float,std::shared_ptr<Npc>>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _V0_t=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xtree(945) : see reference to function template instantiation 'void std::_Wrap_alloc<_Alloc>::construct<_Ty,std::pair<_Ty1,_Ty2>>(_Ty *,_V0_t &&)' being compiled1>          with1>          [1>              _Alloc=std::allocator<std::_Tree_node<std::pair<const float,std::shared_ptr<Npc>>,void *>>,1>              _Ty=std::pair<const float,std::shared_ptr<Npc>>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _V0_t=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xtree(1151) : see reference to function template instantiation 'std::_Tree_node<_Value_type,_Voidptr> *std::_Tree_buy<_Ty,_Alloc>::_Buynode<std::pair<_Ty1,_Ty2>>(_V0_t &&)' being compiled1>          with1>          [1>              _Value_type=std::pair<const float,std::shared_ptr<Npc>>,1>              _Voidptr=void *,1>              _Ty=std::pair<const float,std::shared_ptr<Npc>>,1>              _Alloc=std::allocator<std::pair<const float,std::shared_ptr<Npc>>>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _V0_t=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xtree(1151) : see reference to function template instantiation 'std::_Tree_node<_Value_type,_Voidptr> *std::_Tree_buy<_Ty,_Alloc>::_Buynode<std::pair<_Ty1,_Ty2>>(_V0_t &&)' being compiled1>          with1>          [1>              _Value_type=std::pair<const float,std::shared_ptr<Npc>>,1>              _Voidptr=void *,1>              _Ty=std::pair<const float,std::shared_ptr<Npc>>,1>              _Alloc=std::allocator<std::pair<const float,std::shared_ptr<Npc>>>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _V0_t=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\map(351) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2> std::_Tree<_Traits>::insert<_Ty>(_Valty &&)' being compiled1>          with1>          [1>              _Ty1=std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const float,std::shared_ptr<Npc>>>>>,1>              _Ty2=bool,1>              _Traits=std::_Tmap_traits<float,std::shared_ptr<Npc>,std::less<float>,std::allocator<std::pair<const float,std::shared_ptr<Npc>>>,true>,1>              _Ty=std::pair<double,std::shared_ptr<Npc>>,1>              _Valty=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\map(351) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2> std::_Tree<_Traits>::insert<_Ty>(_Valty &&)' being compiled1>          with1>          [1>              _Ty1=std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const float,std::shared_ptr<Npc>>>>>,1>              _Ty2=bool,1>              _Traits=std::_Tmap_traits<float,std::shared_ptr<Npc>,std::less<float>,std::allocator<std::pair<const float,std::shared_ptr<Npc>>>,true>,1>              _Ty=std::pair<double,std::shared_ptr<Npc>>,1>              _Valty=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          d:\dev\vg\vgo\trunk\src\world\commands.cpp(2231) : see reference to function template instantiation 'std::_Tree_iterator<_Mytree> std::multimap<_Kty,_Ty>::insert<std::pair<_Ty1,_Ty2>>(_Valty &&)' being compiled1>          with1>          [1>              _Mytree=std::_Tree_val<std::_Tree_simple_types<std::pair<const float,std::shared_ptr<Npc>>>>,1>              _Kty=float,1>              _Ty=std::shared_ptr<Npc>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _Valty=std::pair<double,std::shared_ptr<Npc>>1>          ]1>          d:\dev\vg\vgo\trunk\src\world\commands.cpp(2231) : see reference to function template instantiation 'std::_Tree_iterator<_Mytree> std::multimap<_Kty,_Ty>::insert<std::pair<_Ty1,_Ty2>>(_Valty &&)' being compiled1>          with1>          [1>              _Mytree=std::_Tree_val<std::_Tree_simple_types<std::pair<const float,std::shared_ptr<Npc>>>>,1>              _Kty=float,1>              _Ty=std::shared_ptr<Npc>,1>              _Ty1=double,1>              _Ty2=std::shared_ptr<Npc>,1>              _Valty=std::pair<double,std::shared_ptr<Npc>>1>          ]========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Re: VS2012 Compile Warnings

Posted: Mon Feb 09, 2015 4:42 pm
by Lokked
A double is being casted implicitly to a float, probably in the Combine command, as about halfway down, the type reminds of the combine_mmap<> list. I'll fix it when I get a chance. It's not harmful.