Skip to content

Comments

Fix MinGW printf format errors for size_t#3086

Open
Ashutosh0x wants to merge 1 commit intogoogle-deepmind:mainfrom
Ashutosh0x:fix/mingw-printf-format
Open

Fix MinGW printf format errors for size_t#3086
Ashutosh0x wants to merge 1 commit intogoogle-deepmind:mainfrom
Ashutosh0x:fix/mingw-printf-format

Conversation

@Ashutosh0x
Copy link
Contributor

This Pull Request fixes build errors on MinGW toolchains that do not correctly support the %zu format specifier.

Changes

  • Replaced %zu with %llu in hread_pool.cc, engine_util_misc.c, and user_vfs.cc.
  • Cast the corresponding size_t arguments to (unsigned long long) to ensure compatibility across MSVC, MinGW, and other compilers.

Fixes #3039

 MinGW-w64 on certain platforms does not correctly handle the %zu format specifier for size_t, leading to build errors when warnings are treated as errors.

This change replaces %zu with %llu and casts the corresponding arguments to (unsigned long long) for better cross-platform compatibility.

Fixes google-deepmind#3039
@mmossg mmossg self-requested a review February 11, 2026 21:54
@mmossg
Copy link
Collaborator

mmossg commented Feb 11, 2026

FYI, I have a different fix for this which I think better addresses the root issue, and doesn't require changing any of this code. I'll try to send it out tomorrow.

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.

Compiling mujoco with MinGW fails because of unrecognized printf formats

2 participants