Page MenuHome

Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it.

Authored by Ray molenkamp (LazyDodo) on Wed, Feb 12, 6:28 PM.



MSVC has a conformance mode (/permissive-) where the C++ standard is more strictly
enforced. This mode is available on MSVC 15.5+ [1]

This patch enables this mode on compilers that support it and cleans up the few violations it threw up in the process.

  • Mantaflow was using M_PI without requesting them using the _USE_MATH_DEFINES define to opt in to non default behaviour.
  • Collada did not include the right header for std::cerr, this seemingly was fixed for other platforms already but put inside a platform guard.
  • Ghost had some scoping issues regarding uninitialized variables and goto behaviour

Ideally I'd love to see any goto use in ghost be eradicated but that's a diff for another day


Diff Detail

rB Blender

Event Timeline

This revision is now accepted and ready to land.Wed, Feb 12, 6:35 PM

Reverted it, needs more testing on the various compilers

This revision is now accepted and ready to land.Thu, Feb 13, 3:14 PM
Ray molenkamp (LazyDodo) planned changes to this revision.Thu, Feb 13, 3:14 PM
This revision was not accepted when it landed; it landed in state Changes Planned.Fri, Feb 14, 1:13 AM
This revision was automatically updated to reflect the committed changes.