google / mathfu

C++ math library developed primarily for games focused on simplicity and efficiency.

Home Page:http://google.github.io/mathfu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google_Mathfu failed with warning C4305 when build with MSVC

shanshan0309 opened this issue · comments

Hi All,

I tried to build Mathfu with Visual studio 2017 update 5 on Windows Server 2016, but it failed with warning C4305: 'argument': truncation from 'double' to 'const T'. This issue can be reproduced from master revision d036807. Could you help have a look about this issue? Thanks in advance!

Steps to Reproduce:

  1. git clone --recursive https://github.com/google/mathfu.git D:\Google-MathFu\src
  2. Open a VS 2017 command prompt and browse to D:\Google-MathFu
  3. mkdir build_x86 && pushd build_x86
  4. cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.16299.0 ..\src
  5. msbuild /p:Configuration=Release;Platform=Win32 .\mathfu.sln /t:Rebuild

Actual result:
The whole log file please see attachment.
log_x86_build.log
D:\Google-Mathfu\src\unit_tests\quaternion_test\quaternion_test.cpp(468,1): error C2220: warning treated as error - no 'object' file generated [D:\Google-Mathfu\build_x86\unit_tests\quaternion_no_simd_tests.vcxproj]
mathfu::Vector<T, 3> eulers(0.1, 0.2, 0.3);
^
D:\Google-Mathfu\src\unit_tests\quaternion_test\quaternion_test.cpp(475): note: see reference to function template instantiation 'void FromEulerAnglesSplit_Test(const T &)' being compiled
with
[
T=float
]
TEST_ALL_F(FromEulerAnglesSplit);
D:\Google-Mathfu\src\unit_tests\quaternion_test\quaternion_test.cpp(468,1): warning C4305: 'argument': truncation from 'double' to 'const T' [D:\Google-Mathfu\build_x86\unit_tests\quaternion_no_simd_tests.vcxproj]
with
[
T=float
]
mathfu::Vector<T, 3> eulers(0.1, 0.2, 0.3);
^

Thanks! We should have a fix shortly.

Any updates?

Fixed in afc9037.