Add format attribute to printf-style wrappers and fix format string errors#123920
Draft
Add format attribute to printf-style wrappers and fix format string errors#123920
Conversation
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
jkotas
reviewed
Feb 3, 2026
Copilot
AI
changed the title
[WIP] Add format attribute to printf-style API wrappers
Add format attribute to printf-style wrappers and fix format string errors
Feb 3, 2026
jkotas
reviewed
Feb 3, 2026
jkoritzinsky
reviewed
Feb 3, 2026
jkotas
reviewed
Feb 3, 2026
Member
jkoritzinsky
reviewed
Feb 3, 2026
…, str) pattern Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
This was referenced Feb 3, 2026
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.
Add format attribute to printf-style wrappers and fix format string errors
Completed Work:
Review Feedback Addressed:
1. Use PRI macros from inttypes.h (@jkotas) ✅
#ifdef TARGET_64BITblocks to usePRIX64,PRIx64,PRIu64,PRId64macros<inttypes.h>in JIT and VM files for correct host-platform format specifiers2. Use printf("%s", str) pattern (@jkotas) ✅
printf(sstr)toprintf("%s", sstr)#pragma GCC diagnosticblocks3. Use MINIPAL_ATTR_FORMAT_PRINTF throughout (@jkoritzinsky) ✅
src/native/minipal/types.hMINIPAL_ATTR_FORMAT_PRINTF#ifdef __GNUC__blocksAdditional Format Errors Found & Fixed:
The format attribute caught additional errors in corehost:
Files Modified (21 total):
Headers (13): format attributes using MINIPAL_ATTR_FORMAT_PRINTF
Sources (11): format error fixes using inttypes.h and "%s" pattern
Summary:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.