OpenSubdiv icon indicating copy to clipboard operation
OpenSubdiv copied to clipboard

MSVC / Treats all compiler warnings as errors

Open francoiscoulon opened this issue 11 months ago • 2 comments

When compiling with Visual Studio (msvc) warnings are treated as errors which is making compilation fail pretty quickly since with /W3 level there is quite a bunch of warnings (setting CMAKE_COMPILE_WARNING_AS_ERROR doesn't fix the problem ¯\_ (ツ)_/¯ ). It's also not mimicking gcc, clang and icc side, there the flag -Werror is not set.

For "homogeneity" could the /WX be removed or commented out in the MSVC block currently here in the code ?

And if someone has a suggestion to avoid having to fix the CMakelist.txt manually please comment.

Thank you !

francoiscoulon avatar Mar 06 '24 23:03 francoiscoulon

Filed as internal issue #OSD-434

davidgyu avatar Mar 11 '24 18:03 davidgyu

Good point about the inconsistency across mcvc, gcc, icc, etc., though I think we'll want to address this inconsistency by enabling warnings as errors for all of these compilers.

Enabling warnings as errors within the OpenSubdiv build itself helps us catch issues that might affect client code using OpenSubdiv headers within client build systems.

We build with Visual Studio (2015, 2017, 2019, 2022) from the Command Prompt and from the IDE and Ninja as part of our regular development and testing.

Can you share more about when this is causing your builds of OpenSubdiv to fail?

Thanks!

davidgyu avatar Mar 19 '24 05:03 davidgyu