Some pragma warnings are not more needed for VS2015 compilation this will remove them.
Removing some specific code for older version than VS2015.
Forcing build to fail if compiling with VS older than VS2015.
Not sure either why VS2015 doesn't get the error. Could you try to see what happens when the version check is removed? It doesn't make sense to add this new conditional as-is. The only meaningful patches would be, In my opinion, no conditional (the warning is silenced on all versions), or a conditional that keeps the old behavior for 2013 and introduces a change for the new version (that would be <= 1800).
Also, the typo was made twice in this file, for warning C4836 as well.
I'm removing the Accepted status while this is investigated.
So a bit of research and test builds as well.
Looks like VS2013 uses older compiler for which is 4351 dangerous and can lead to unexpected behaviour, but for VS2015 it is safe by compiler.
One situation where the new behavior can result in unexpected behavior is when placement new is used to construct the object that has the array as a member, and the program depends on the contents that the memory (for the elements of the default initialized array) had before the call to placement new. In this case, the older compiler would have left the contents of memory unchanged, but the new behavior will cause default initialization of the array elements, overwriting the original contents in memory.
In previous versions of Visual C++, when an array was in a constructor's member initialization list, the elements of the array may not have been default initialized in some cases.
So to the builds without version guard.
not disabled c4351 -> a bunch of warnings
disabled c4351 -> no warning related to this
not disabled c4351 -> no warning related to this
not disabled c4351 and building with Wall option -> no warning related to this
Looks like VS2015 stopped worried about 4351 warning so it now depends how long there will be game support for 2013. After that one drops, pragma warning for that can be removed.
For future reference.
Still don't know why but we have our own macro in source/lib/sysdep/compiler.h :
#ifdef _MSC_VER # define MSC_VERSION _MSC_VER #else # define MSC_VERSION 0 #endif
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... source/lib/sysdep/os/win/wposix/wtime.h | 1| /*·Copyright·(C)·2017·Wildfire·Games. | | [NORMAL] LicenseYearBear: | | License should have "2019" year instead of "2017" Executing section JS... Executing section cli...