I often face warning like this using VSCode and CMake when compiling my code:
C:\Program Files\Microsoft Visual Studio\2022\
Community\VC\Tools\MSVC\14.31.31103\include\xuti
lity(136,48): warning C4244: 'initializing': con
version from 'const double' to '_Ty', possible l
oss of data [C:\IBOIS57\_Code\Software\Python\co
mpas_wood\backend\build_win\wood.vcxproj]
I clearly understand that there is an issue with my code when types are not the same. But this error points somewhere that is not my code. Is it possible to show where this warning is coming from?
I am already printing preprocessing and compilation messages in verbose mode.
This is the full message:
-- Build files have been written to: C:/IBOIS57/_Code/Software/Python/compas_wood/backend/build_win
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Checking Build System
Building Custom Rule C:/IBOIS57/_Code/Software/Python/compas_wood/backend/CMakeLists.txt
clipper.engine.cpp
clipper.offset.cpp
Generating Code...
Clipper2.vcxproj -> C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\Release\Clipper2.lib
Building Custom Rule C:/IBOIS57/_Code/Software/Python/compas_wood/backend/CMakeLists.txt
stb_image.cpp
stb_image_write.cpp
Generating Code...
STB.vcxproj -> C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\Release\STB.lib
Building Custom Rule C:/IBOIS57/_Code/Software/Python/compas_wood/backend/CMakeLists.txt
imgui_demo.cpp
imgui_draw.cpp
imgui_tables.cpp
imgui_widgets.cpp
imgui.cpp
imgui_impl_opengl3.cpp
imgui_impl_glfw.cpp
Generating Code...
imgui_lib.vcxproj -> C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\Release\imgui_lib.lib
Building Custom Rule C:/IBOIS57/_Code/Software/Python/compas_wood/backend/CMakeLists.txt
cmake_pch.cxx
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(135,1): warning C4267: 'initializing': conversion from 'siz
e_t' to '_Ty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=int
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(134): message : see reference to function template instanti
ation '_Ty *std::construct_at<_Objty,unsigned __int64,void>(_Ty *const ,unsigned __int64 &&) noexcept(<expr>)' being compiled
[C:\IBOIS57\_Code\Software\Pytho
n\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=int,
_Objty=int
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(602): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,unsigned __int64>(_Alloc &,_Objty *const ,unsigned __int64 &&)' being compiled [C:\IBOIS57\_Co
de\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<int>,
_Ty=int,
_Objty=int
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(607): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,unsigned __int64>(_Alloc &,_Objty *const ,unsigned __int64 &&)' being compiled [C:\IBOIS57\_Co
de\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<int>,
_Ty=int,
_Objty=int
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(620): message : see reference to function template instantiat
ion '_Ty &std::vector<_Ty,std::allocator<_Ty>>::_Emplace_back_with_unused_capacity<unsigned __int64>(unsigned __int64 &&)' being compiled [C:\IBOIS57\_Code\So
ftware\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=int
]
C:\IBOIS57\_Code\Software\Python\compas_wood\backend\src/viewer/include/opengl/opengl_triangulation.h(151): message : see reference to function template insta
ntiation '_Ty &std::vector<_Ty,std::allocator<_Ty>>::emplace_back<unsigned __int64>(unsigned __int64 &&)' being compiled [C:\IBOIS57\_Code\Software\Python\com
pas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=int
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(673,1): warning C4267: 'initializing': conversion from 'size
_t' to '_Objty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Objty=int
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(135,50): warning C4244: 'initializing': conversion from '_T
y' to '_Ty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=double
]
and
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(134): message : see reference to function template instanti
ation '_Ty *std::construct_at<_Objty,double,void>(_Ty *const ,double &&) noexcept(<expr>)' being compiled [C:\IBOIS57\_Code\Software\Python\compas_wood\backen
d\build_win\wood.vcxproj]
with
[
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(602): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,double>(_Alloc &,_Objty *const ,double &&)' being compiled [C:\IBOIS57\_Code\Software\Python\c
ompas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(607): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,double>(_Alloc &,_Objty *const ,double &&)' being compiled [C:\IBOIS57\_Code\Software\Python\c
ompas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(620): message : see reference to function template instantiat
ion '_Ty &std::vector<_Ty,std::allocator<_Ty>>::_Emplace_back_with_unused_capacity<double>(double &&)' being compiled [C:\IBOIS57\_Code\Software\Python\compas
_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=float
]
C:\IBOIS57\_Code\Software\Python\compas_wood\backend\src\wood\include\cgal_mesh_util.h(606): message : see reference to function template instantiation '_Ty &
std::vector<_Ty,std::allocator<_Ty>>::emplace_back<double>(double &&)' being compiled [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcx
proj]
with
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(680,47): warning C4244: 'initializing': conversion from '_Ty
' to '_Objty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=double
]
and
[
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(135,50): warning C4244: 'initializing': conversion from 'co
nst double' to '_Ty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(134): message : see reference to function template instanti
ation '_Ty *std::construct_at<_Objty,const double&,void>(_Ty *const ,const double &) noexcept(<expr>)' being compiled [C:\IBOIS57\_Code\Software\Python\compas
_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(602): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,const double&>(_Alloc &,_Objty *const ,const double &)' being
compiled [C:\IBOIS57\_Code\Softw
are\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(607): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,const double&>(_Alloc &,_Objty *const ,const double &)' being
compiled [C:\IBOIS57\_Code\Softw
are\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(620): message : see reference to function template instantiat
ion '_Ty &std::vector<_Ty,std::allocator<_Ty>>::_Emplace_back_with_unused_capacity<const double&>(const double &)' being compiled [C:\IBOIS57\_Code\Software\P
ython\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=float
]
C:\IBOIS57\_Code\Software\Python\compas_wood\backend\src\wood\include\cgal_mesh_util.h(710): message : see reference to function template instantiation '_Ty &
std::vector<_Ty,std::allocator<_Ty>>::emplace_back<const double&>(const double &)' being compiled [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_
win\wood.vcxproj]
with
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(680,47): warning C4244: 'initializing': conversion from 'con
st double' to '_Objty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(135,50): warning C4244: 'initializing': conversion from '_T
y' to '_Ty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=const double
]
and
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(134): message : see reference to function template instanti
ation '_Ty *std::construct_at<_Objty,const double,void>(_Ty *const ,const double &&) noexcept(<expr>)' being compiled [C:\IBOIS57\_Code\Software\Python\compas
_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(602): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,const double>(_Alloc &,_Objty *const ,const double &&)' being
compiled [C:\IBOIS57\_Code\Softw
are\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(607): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,const double>(_Alloc &,_Objty *const ,const double &&)' being
compiled [C:\IBOIS57\_Code\Softw
are\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(620): message : see reference to function template instantiat
ion '_Ty &std::vector<_Ty,std::allocator<_Ty>>::_Emplace_back_with_unused_capacity<const double>(const double &&)' being compiled [C:\IBOIS57\_Code\Software\P
ython\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=float
]
C:\IBOIS57\_Code\Software\Python\compas_wood\backend\src\wood\include\cgal_mesh_util.h(755): message : see reference to function template instantiation '_Ty &
std::vector<_Ty,std::allocator<_Ty>>::emplace_back<const double>(const double &&)' being compiled [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_
win\wood.vcxproj]
with
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(680,47): warning C4244: 'initializing': conversion from '_Ty
' to '_Objty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=const double
]
and
[
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(136,48): warning C4244: 'initializing': conversion from '_T
y' to '_Ty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=double
]
and
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(673): message : see reference to function template instantia
tion '_Ty *std::construct_at<_Objty,double,void>(_Ty *const ,double &&) noexcept' being compiled [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_w
in\wood.vcxproj]
with
[
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(602): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,double>(_Alloc &,_Objty *const ,double &&)' being compiled [C:\IBOIS57\_Code\Software\Python\c
ompas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(607): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,double>(_Alloc &,_Objty *const ,double &&)' being compiled [C:\IBOIS57\_Code\Software\Python\c
ompas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(136,48): warning C4244: 'initializing': conversion from 'co
nst double' to '_Ty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(673): message : see reference to function template instantia
tion '_Ty *std::construct_at<_Objty,const double&,void>(_Ty *const ,const double &) noexcept' being compiled [C:\IBOIS57\_Code\Software\Python\compas_wood\bac
kend\build_win\wood.vcxproj]
with
[
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(602): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,const double&>(_Alloc &,_Objty *const ,const double &)' being
compiled [C:\IBOIS57\_Code\Softw
are\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(607): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,const double&>(_Alloc &,_Objty *const ,const double &)' being
compiled [C:\IBOIS57\_Code\Softw
are\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(136,48): warning C4244: 'initializing': conversion from '_T
y' to '_Ty', possible loss of data [C:\IBOIS57\_Code\Software\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Ty=const double
]
and
[
_Ty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(673): message : see reference to function template instantia
tion '_Ty *std::construct_at<_Objty,const double,void>(_Ty *const ,const double &&) noexcept' being compiled [C:\IBOIS57\_Code\Software\Python\compas_wood\bac
kend\build_win\wood.vcxproj]
with
[
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(602): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,const double>(_Alloc &,_Objty *const ,const double &&)' being
compiled [C:\IBOIS57\_Code\Softw
are\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(607): message : see reference to function template instantiat
ion 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,const double>(_Alloc &,_Objty *const ,const double &&)' being
compiled [C:\IBOIS57\_Code\Softw
are\Python\compas_wood\backend\build_win\wood.vcxproj]
with
[
_Alloc=std::allocator<float>,
_Ty=float,
_Objty=float
]
main.cpp
wood_globals.cpp
clipper_util.cpp
wood_element.cpp
wood_joint.cpp
wood_test.cpp
wood_main.cpp
viewer_wood.cpp
wood_xml.cpp
cgal_mesh_boolean.cpp
opengl_globals_geometry.cpp
opengl_globals.cpp
Generating Code...