google / mathfu

C++ math library developed primarily for games focused on simplicity and efficiency.
http://google.github.io/mathfu
Apache License 2.0
1.4k stars 188 forks source link

Google_Mathfu failed with warning C4100 when build with MSVC #39

Open QuellaZhang opened 5 years ago

QuellaZhang commented 5 years ago

Hi All,

I tried to build Mathfu with Visual studio 2017 on Windows Server 2016, but it failed with warning C4100: 'precision': unreferenced formal parameter. This issue can be reproduced from master revision a120edf. Could you help have a look about this issue? Thanks in advance!

We have made workaround for this: google_mathfu_warning_c4100.patch.txt

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.17134.0 ..\src
  5. msbuild /p:Configuration=Release;Platform=Win32 .\mathfu.sln /t:Rebuild

Actual result: D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(117): error C2220: warning treated as error - no 'object' file generated D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(117): warning C4100: 'precision': unreferenced formal parameter D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(130): note: see reference to function template instantiation 'void anonymous-namespace'::TestHelpers_Test<float>(const T &)' being compiled with [ T=float ] D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(338): warning C4100: 'precision': unreferenced formal parameter D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(367): note: see reference to function template instantiation 'voidanonymous-namespace'::MultQuatFloatFlipsQuat_Test(const T &)' being compiled with [ T=float ] D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(437): warning C4100: 'precision': unreferenced formal parameter D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(470): note: see reference to function template instantiation 'void anonymous-namespace'::ToAngleAxisReturnsSmallQuat_Test<float>(const T &)' being compiled with [ T=float ] D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(625): warning C4100: 'precision': unreferenced formal parameter D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(645): note: see reference to function template instantiation 'voidanonymous-namespace'::SlerpResultIsUnit_Test(const T &)' being compiled with [ T=float ] D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(688): warning C4100: 'precision': unreferenced formal parameter D:\Google-MathFu\src\unit_tests\quaternion_test\quaternion_test.cpp(715): note: see reference to function template instantiation 'void `anonymous-namespace'::Slerp_Test(const T &)' being compiled with [ T=float ]