Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings-as-errors for msvc 2019 x64 #4825

Merged
merged 3 commits into from
Dec 8, 2022
Merged

fix warnings-as-errors for msvc 2019 x64 #4825

merged 3 commits into from
Dec 8, 2022

Conversation

Gargaj
Copy link
Contributor

@Gargaj Gargaj commented Dec 3, 2022

Warnings-as-errors currently breaks on MSVC 2019 Debug X64:

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(713): message : see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,float,double,float>(_Alloc &,_Objty *const ,float &&,double &&,float &&)' being compiled
1>        with
1>        [
1>            _Alloc=std::allocator<aiVector3D>,
1>            _Ty=aiVector3t<ai_real>,
1>            _Objty=aiVector3t<ai_real>
1>        ] (compiling source file ..\..\assimp\code\Common\StandardShapes.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(713): message : see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,float,double,float>(_Alloc &,_Objty *const ,float &&,double &&,float &&)' being compiled
1>        with
1>        [
1>            _Alloc=std::allocator<aiVector3D>,
1>            _Ty=aiVector3t<ai_real>,
1>            _Objty=aiVector3t<ai_real>
1>        ] (compiling source file ..\..\assimp\code\Common\StandardShapes.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(731): message : see reference to function template instantiation 'void std::vector<aiVector3D,std::allocator<aiVector3D>>::_Emplace_back_with_unused_capacity<_Ty,double,_Ty>(_Ty &&,double &&,_Ty &&)' being compiled
1>        with
1>        [
1>            _Ty=ai_real
1>        ] (compiling source file ..\..\assimp\code\Common\StandardShapes.cpp)
1>..\..\assimp\code\Common\StandardShapes.cpp(471): message : see reference to function template instantiation 'void std::vector<aiVector3D,std::allocator<aiVector3D>>::emplace_back<ai_real,double,ai_real>(ai_real &&,double &&,ai_real &&)' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xmemory(681,68): warning C4244: 'argument': conversion from '_Ty' to 'TReal', possible loss of data
1>        with
1>        [
1>            _Ty=double
1>        ]
1>        and
1>        [
1>            TReal=ai_real
1>        ] (compiling source file ..\..\assimp\code\Common\StandardShapes.cpp)

Worth mentioning that this is with ASSIMP_DOUBLE_PRECISION set to off. With it set to on it's a whole 'nother world of compile pain.

Are the CI settings set to warnings-as-errors off?

@Gargaj Gargaj changed the title fix warnings-as-errors for msvc x64 fix warnings-as-errors for msvc 2019 x64 Dec 3, 2022
@Gargaj
Copy link
Contributor Author

Gargaj commented Dec 3, 2022

After a bit of digging my suspicion is that the CI is running on VS2022 because the C/C++ CI has

    - name: Set Compiler Environment for Hunter on Windows
      if: startsWith(matrix.name, 'windows') && endsWith(matrix.name, 'hunter')
      uses: lukka/set-shell-env@v1
      with:
        VS160COMNTOOLS: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools

but that set-shell-env script seems to have a bug now with custom env vars: lukka/set-shell-env#3
image

Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Any reason for not using const instead of constexpr.

@kimkulling kimkulling merged commit 0fdae28 into assimp:master Dec 8, 2022
@kimkulling
Copy link
Member

Merged, thanks a lot for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants