From b01ca2f752270210680d89eff9e6cbacb1cbad50 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 20 Oct 2026 14:46:35 +0900 Subject: [PATCH] [ruby/prism] Fix printf format attribute on ucrt64-mingw gcc 16.3 `__MINGW_PRINTF_FORMAT` is defined in stdio.h. ``` prism/buffer.c: In function 'pm_buffer_append_format': prism/buffer.c:114:5: warning: function 'pm_buffer_append_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] 114 | int result = vsnprintf(NULL, 0, format, arguments); | ^~~ prism/buffer.c:123:9: warning: function 'pm_buffer_append_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] 123 | vsnprintf(buffer->value + cursor, length, format, arguments); | ^~~~~~~~~ ``` https://github.com/ruby/prism/commit/72da47973e --- prism/compiler/format.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prism/compiler/format.h b/prism/compiler/format.h index 32f4c3c6d77..f3647b032a5 100644 --- a/prism/compiler/format.h +++ b/prism/compiler/format.h @@ -4,6 +4,8 @@ #ifndef PRISM_COMPILER_FORMAT_H #define PRISM_COMPILER_FORMAT_H +#include + /** * Certain compilers support specifying that a function accepts variadic * parameters that look like printf format strings to provide a better developer