CMake: set MSVC warning level to 4#1711
Conversation
|
@MarcelRaad, thanks for your PR! By analyzing the history of the files in this pull request, we identified @billhoffman, @Sukender and @jzakrzewski to be potential reviewers. |
|
It seems this warning level causes numerous tests run by cmake to fail... |
I can only imagine that my CMake configuration wasn't updated when I moved the warning suppression from the top-level CMakeLists.txt to the one in the lib directory and the recv detection code doesn't compile because of the warning. I'll try moving it back to the top-level directory. |
169be63 to
680d068
Compare
|
Still the same problem: Strange that it works on my machine (with the Ninja generator, though) but not on AppVeyor. :-( |
680d068 to
1ce6d2a
Compare
|
I could reproduce this now with the Visual Studio project file generator back-end (which I haven't got to build anything yet, but generating the CMake cache works). Strangely, it failed because of a level 1 warning with CURL_WERROR, so I split the commit fixing CURL_WERROR into new PR #1715 now. Maybe CMAKE_C_FLAGS is used for the configuration tests while CMAKE_C_FLAGS_DEBUG/CMAKE_C_FLAGS_RELEASE is not? |
1ce6d2a to
24a58d7
Compare
|
What's that Travis failure again.... My mobile Chrome doesn't want to show the AppVeyor log, I'll check tomorrow at my desktop computer. |
24a58d7 to
c53d665
Compare
|
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. Closes curl#1711
c53d665 to
6a0d2ab
Compare
|
Completely unrelated Travis failure again, test 2033 [NTLM connection mapping, pipelining enabled] for the newly added libressl job this time. AppVeyor is happy now, so this is the version I would push. Unfortunately there were more evil macros than I thought, even using SIG_ERR always results in a warning under MSVC 11 (2012) because of a direct cast from 32-bit integer constant to 64-bit function pointer within the macro. |
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 to get a clean CURL_WERROR build.
Also, /WX got added twice to the compiler flags for the release build and not
at all for the debug build. Fix this by using CMAKE_C_FLAGS instead of
CMAKE_C_FLAGS_RELEASE and CMAKE_C_FLAGS_DEBUG.