Skip to content

add sensible constraints for using __MINGW_PRINTF_FORMAT in include/C… - #1896

Closed
Keith-H-Utron wants to merge 1 commit into
cpputest:masterfrom
Keith-H-Utron:1832-fix-ucrt64-autotools-warning-__MINGW_PRINTF_FORMAT-is-an-unrecognized-format-function-type
Closed

Keith-H-Utron wants to merge 1 commit into
cpputest:masterfrom
Keith-H-Utron:1832-fix-ucrt64-autotools-warning-__MINGW_PRINTF_FORMAT-is-an-unrecognized-format-function-type

Conversation

@Keith-H-Utron

Copy link
Copy Markdown

…ppUTest/CppUTestConfig.h to silence warnings when building for UCRT64 with autotools

…ppUTest/CppUTestConfig.h to silence warnings when building for UCRT64 with autotools
thetic added a commit to thetic/mu.tiny that referenced this pull request Sep 10, 2026
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
@Keith-H-Utron

Copy link
Copy Markdown
Author

After more testing, this isn't the right solution. More light was found by reading & testing out the code in Martin Licht's article, The long double trouble with MinGW and Windows, which shows that one has two options for mitigating the problem, and the one I chose here is half-baked. Sorry for that. Closing this PR.

@Keith-H-Utron
Keith-H-Utron deleted the 1832-fix-ucrt64-autotools-warning-__MINGW_PRINTF_FORMAT-is-an-unrecognized-format-function-type branch September 10, 2026 18:03
@basvodde

Copy link
Copy Markdown
Member

no problem, thanks for contributing anyways!

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