Skip to content

Resolve MSVC warnings for cleaner builds#82

Merged
dav-og merged 1 commit intomainfrom
fix/msvc-warnings
Dec 13, 2025
Merged

Resolve MSVC warnings for cleaner builds#82
dav-og merged 1 commit intomainfrom
fix/msvc-warnings

Conversation

@dav-og
Copy link
Copy Markdown
Collaborator

@dav-og dav-og commented Dec 13, 2025

Address MSVC warnings (C4005, C4018, C4189, C4267).

Changes

  • C4005 (macro redefinition): Remove conflicting CHRONO_VERSION macro; add fallback in logger_backend.cpp
  • C4018 (signed/unsigned mismatch): Use Eigen::Index for Eigen containers, size_t for STL containers
  • C4267 (narrowing conversion): Add explicit casts where APIs require int
  • C4189 (unused variable): Remove rest_length, col_dof, total_dofs, width_array, etc.
  • Shadowing: Rename t_taut_tau_init in ExcitationConvolution
  • Third-party: Mark Irrlicht includes as SYSTEM in CMakeLists.txt

Tested: Release build, regression tests pass.

Address MSVC warnings (C4005, C4018, C4189, C4267)

Changes:
- Remove conflicting CHRONO_VERSION macro definition in logging.h; add fallback in logger_backend.cpp to avoid conflict with Chrono's ChVersion.h (C4005)
- Use Eigen::Index for Eigen container loops instead of int/size_t (C4018)
- Use size_t for STL container loops in demos/tests (C4018)
- Add explicit casts for size_t-to-int conversions where APIs require int (C4267)
- Remove unused variables: rest_length, col_dof, total_dofs, bodies, dampers,  samples, width_array (C4189)
- Fix variable shadowing: rename t_tau to t_tau_init in ExcitationConvolution
- Mark Irrlicht includes as SYSTEM in CMakeLists.txt to suppress warnings

Build tested: Release configuration, all (working) regression tests pass.
@dav-og dav-og merged commit 4efaa06 into main Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant