Handmade Hero»Forums»Code
Benjamin Pedersen
41 posts
Mathematician
Visual Studio 2015 warnings and errors
Edited by Benjamin Pedersen on Reason: solution suggestion
The Handmade Hero code triggers a lot of warnings (primarily variable shadowing) in VS2015. These can be supressed with the flag -Wv:18.
Maybe Casey could add this, so VS2015 users don't have to do this every time.

VS2015 also is not happy about implicitly casting from double to float in line 40 of handmade_intrinsics.h.
Maybe use fabsf instead of fabs?
Mārtiņš Možeiko
2242 posts / 1 project
Visual Studio 2015 warnings and errors
But adding -Wv:18 will generate warning for VS2013 users.
VS2015 users need to modify build script anyway for VS2015 (at least to call proper vsvars.bat file), so they can easily add -Wv:18 there at the same time.
Benjamin Pedersen
41 posts
Mathematician
Visual Studio 2015 warnings and errors
mmozeiko
But adding -Wv:18 will generate warning for VS2013 users.

Maybe, but I tried using -Wv:30, and VS2015 just did what it normally would.

mmozeiko

VS2015 users need to modify build script anyway for VS2015 (at least to call proper vsvars.bat file), so they can easily add -Wv:18 there at the same time.

I have never done anything to build.bat other than adding -Wv:18. Casey calls vcvarsall.bat once through misc\shell.bat to avoid waiting all too on Microsoft.
Mārtiņš Možeiko
2242 posts / 1 project
Visual Studio 2015 warnings and errors
Edited by Mārtiņš Možeiko on
I was talking about VS2013 which doesn't understand -Wv:18 argument. It's actually an error, not warning for VS2013.

Anway, if you are modifying shell.bat, then put -Wv:18 setting there.
Put "set CL=-Wv:18" in shell.bat and cl.exe from build.bat will automatically pick up this setting.