-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
winbuild: build with warning level 4 #1667
Conversation
@MarcelRaad, thanks for your PR! By analyzing the history of the files in this pull request, we identified @yangtse, @mback2k and @msnelling to be potential reviewers. |
Coverage increased (+0.06%) to 76.029% when pulling 48996626a0fe5ae996cee32beb9dec64af0cd084 on MarcelRaad:winbuild_w4 into a548183 on curl:master. |
"AppVeyor was unable to build non-mergeable pull request" - no idea what that means and found little info on the internet. I hope that will go away after rebase and force-push. |
Coverage decreased (-0.008%) to 75.953% when pulling 19c0336875fa5f0641a3648629689d1eec0930dc on MarcelRaad:winbuild_w4 into 59a0fb2 on curl:master. |
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. |
It'd be cool to also make the cmake build generate that warning level, as that would then make the appveyor CI builds run like that and better help us maintain this level! |
I think that should be fine but to gather any objections I've taken it to the mailing list first. |
ah I see you've already disabled it in winbuild, I'd leave it for now and we'll see if anyone objects on the mailing list. If not I'll add it to the project files as well. |
Thank you! I have to keep in mind the mailing list more. |
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
This is consistent with 7bc6456, which
changed the warning level from 3 to 4 for the Visual Studio project
files. Also define WIN32_LEAN_AND_MEAN consistently, which avoids
unnecessarily including stuff that emits a lot of level 4 warnings when
using older Windows SDK versions.