Warning C4127 compiling Eigen v3.4.0 with VS2019 v16.10.4

Summary

The following warning appears in many Eigen files: warning C4127: conditional expression is constant

Some cases:

  • CoreEvaluators.h (204, ...)
  • CwiseNullaryOp.h (148)
  • GeneralBlockPanelKernel.h (1429, ...)
  • Memory.h (405, ...)
  • SparseCompressedBase.h (58)
  • SimplicialCholesky.h (664)

and many others...

Environment

  • Operating System : Windows
  • Architecture : x86
  • Eigen Version : 3.4.0
  • Compiler Version : VS2019 v16.10.4
  • Compile Flags : -O2
  • Vector Extension : SSE2