8000 Type mismatch: MSVC: warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data · Issue #1189 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Type mismatch: MSVC: warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data #1189
Open
@blizzard4591

Description

@blizzard4591

Dear manifold team,
we are trying to use manifold within our codebase and usually compile third-party code on MSVC 2019/2022 with /W0 /WX, meaning disable all warnings and make every warning an error.
Interestingly, Manifold produces warnings if with all warnings disabled (with TBB disabled):

2>cl /c /I"E:\playground\manifold-3.0.1\include" /I"E:\playground\manifold-3.0.1\build\include" /Zi /W1 /WX- /diagnostics:column /O2 /Ob1 /D _WINDLL /D _MBCS /D WIN32 /D _WINDOWS /D NDEBUG /D NOMINMAX /D "MANIFOLD_PAR=-1" /D "CMAKE_INTDIR=\"RelWithDebInfo\"" /D manifold_EXPORTS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++17 /Fo"manifold.dir\RelWithDebInfo\\" /Fd"manifold.dir\RelWithDebInfo\vc143.pdb" /external:W1 /Gd /TP /errorReport:prompt  /bigobj "E:\playground\manifold-3.0.1\src\boolean3.cpp" "E:\playground\manifold-3.0.1\src\boolean_result.cpp" "E:\playground\manifold-3.0.1\src\constructors.cpp" "E:\playground\manifold-3.0.1\src\csg_tree.cpp" "E:\playground\manifold-3.0.1\src\edge_op.cpp" "E:\playground\manifold-3.0.1\src\face_op.cpp" "E:\playground\manifold-3.0.1\src\impl.cpp" "E:\playground\manifold-3.0.1\src\manifold.cpp" "E:\playground\manifold-3.0.1\src\polygon.cpp" "E:\playground\manifold-3.0.1\src\properties.cpp" "E:\playground\manifold-3.0.1\src\quickhull.cpp" "E:\playground\manifold-3.0.1\src\sdf.cpp" "E:\playground\manifold-3.0.1\src\smoothing.cpp" "E:\playground\manifold-3.0.1\src\sort.cpp" "E:\playground\manifold-3.0.1\src\subdivision.cpp"
2>boolean3.cpp
2>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\algorithm(372,15): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
2>(compiling source file '../../src/boolean3.cpp')
2>    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\include\algorithm(372,15):
2>    the template instantiation context (the oldest one first) is
2>        E:\playground\manifold-3.0.1\src\collider.h(285,5):
2>        see reference to function template instantiation 'void manifold::for_each_n<manifold::CountingIterator<size_t>,manifold::collider_internal::CreateRadixTree>(manifold::ExecutionPolicy,Iter,size_t,F)' being compiled
2>        with
2>        [
2>            Iter=manifold::CountingIterator<size_t>,
2>            F=manifold::collider_internal::CreateRadixTree
2>        ]
2>        E:\playground\manifold-3.0.1\src\parallel.h(399,3):
2>        see reference to function template instantiation 'void manifold::for_each<Iter,F>(manifold::ExecutionPolicy,Iter,Iter,F)' being compiled
2>        with
2>        [
2>            Iter=manifold::CountingIterator<size_t>,
2>            F=manifold::collider_internal::CreateRadixTree
2>        ]
2>        E:\playground\manifold-3.0.1\src\parallel.h(389,8):
2>        see reference to function template instantiation '_Fn std::for_each<Iter,F>(_InIt,_InIt,_Fn)' being compiled
2>        with
2>        [
2>            _Fn=manifold::collider_internal::CreateRadixTree,
2>            Iter=manifold::CountingIterator<size_t>,
2>            F=manifold::collider_internal::CreateRadixTree,
2>            _InIt=manifold::CountingIterator<size_t>
2>        ]

The problem seems to be Vec<int> which are then dereferenced in the for_each and used with size_t's.

You can find the build log without /WX here:
Manifold_build.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0