winbuild: build with warning level 4 #1667
Original problem disappeared, now it's
for one of the AppVeyor builds :-(
Give it some time, that seems to occasionally with CI builds, they are overloaded and things slow down to the point where nothing can happen.
I tried this in both VS 2008 and 2010 and I get one real warning which I just fixed and then a bunch of superfluous C4127: conditional expression is constant.
So I'm sure those are all while(0 or 1 etc. Depending on how easy it is we could do them all with _pragmas using a macro like WHILE_FALSE or for while(1) use for(;;) since iirc vs doesn't warn for that. The select though is already a macro FD_SET which is defined in winsock and uses while(0), that might not be possible to wrap, older vs is picky about when it applies some __pragmas
Ah, I forgot about that warning :-( I tested with VS 2015 and 2017 with Windows SDK 10, which replaces that warning in the
Now I remember that C4127 is also issued with certain libcurl feature combinations because some functions become macros defined to a constant. I'm not sure if it will be easy to catch and change all of them. Maybe we could just suppress it by building with /wd4127, and also for the VS project files? I always compile with
myself instead of the default /W4 when using the VS project files, 4127 being the only warning which is on by default.
The MSVC warning level defaults to 3 in CMake. Change it to 4, which is consistent with the Visual Studio and NMake builds. Disable level 4 warning C4127 for the library and additionally C4306 for the test servers to get a clean CURL_WERROR build as that warning is raised in some macros in older Visual Studio versions. Ref: curl#1667 (comment) Closes curl#1711