Skip to content

Only use __MINGW_PRINTF_FORMAT under MinGW ANSI stdio - #104

Merged
thetic merged 1 commit into
mainfrom
mingw-ucrt-printf-format
Sep 10, 2026
Merged

thetic merged 1 commit into
mainfrom
mingw-ucrt-printf-format

Conversation

@thetic

@thetic thetic commented Sep 10, 2026 •

Copy link
Copy Markdown
Owner

Description

On UCRT-based MinGW builds, __USE_MINGW_ANSI_STDIO defaults to 0, so unconditionally using __MINGW_PRINTF_FORMAT selects the wrong printf format archetype and trips -Wformat (fatal, since CMAKE_COMPILE_WARNING_AS_ERROR is on). This restricts it to the classic MinGW runtime, where __USE_MINGW_ANSI_STDIO defaults to 1, and falls back to plain printf otherwise — the same fix as cpputest/cpputest#1896, which this codebase's format-checking macro was originally derived from. Also adds a UCRT64 leg to the MSYS CI matrix so this path is actually exercised (previously no CI job built against UCRT).

Related Issues

N/A

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Manual Verification (Optional)

N/A — covered by the new MSYS UCRT64 CI leg added in this PR.

Checklist

  • I have written/updated documentation in docs/ for any user-facing changes. — N/A, internal build-only fix, no user-facing behavior change.
  • My code follows the project's naming conventions (mu::tiny namespace, INCLUDED_MU_TINY_ guards, mutiny_ C-prefix).
  • For new features, I have considered if a C-interface adapter (.h and .c.cpp) is required for parity. — N/A, not a new feature.
  • I have reviewed the CONTRIBUTING.md file to ensure compliance with architectural guidelines.

On UCRT-based MinGW builds, __USE_MINGW_ANSI_STDIO defaults to 0,
so __MINGW_PRINTF_FORMAT no longer matches the CRT's printf and
trips format-checking warnings. Restrict it to the classic MinGW
runtime and fall back to plain printf otherwise, matching cpputest/cpputest#1896.

Add a UCRT64 leg to the MSYS CI matrix so this path is covered.

Claude-Session: https://claude.ai/code/session_01AK4HQuuasGpAUvZtortGkH
@thetic
thetic force-pushed the mingw-ucrt-printf-format branch from 0d4170c to d056032 Compare September 10, 2026 03:28
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor
TestsPassed ✅Skipped ⚠️Failed
JUnit Tests1083 ran1074 passed9 skipped0 failed

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.947%. remained the same — mingw-ucrt-printf-format into main

@thetic
thetic merged commit 880b85e into main Sep 10, 2026
42 checks passed
@thetic
thetic deleted the mingw-ucrt-printf-format branch September 10, 2026 03:34
@thetic thetic mentioned this pull request Sep 10, 2026
5 tasks done
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.

2 participants