Repository navigation
Only use __MINGW_PRINTF_FORMAT under MinGW ANSI stdio - #104
Merged
Merged
Conversation
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
force-pushed
the
mingw-ucrt-printf-format
branch
from
September 10, 2026 03:28
0d4170c to
d056032
Compare
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On UCRT-based MinGW builds,
__USE_MINGW_ANSI_STDIOdefaults to0, so unconditionally using__MINGW_PRINTF_FORMATselects the wrong printf format archetype and trips-Wformat(fatal, sinceCMAKE_COMPILE_WARNING_AS_ERRORis on). This restricts it to the classic MinGW runtime, where__USE_MINGW_ANSI_STDIOdefaults to1, and falls back to plainprintfotherwise — the same fix as cpputest/cpputest#1896, which this codebase's format-checking macro was originally derived from. Also adds aUCRT64leg 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
Manual Verification (Optional)
N/A — covered by the new
MSYS UCRT64CI leg added in this PR.Checklist
docs/for any user-facing changes. — N/A, internal build-only fix, no user-facing behavior change.mu::tinynamespace,INCLUDED_MU_TINY_guards,mutiny_C-prefix)..hand.c.cpp) is required for parity. — N/A, not a new feature.CONTRIBUTING.mdfile to ensure compliance with architectural guidelines.