RFR: 8374168: Resolve disabled warnings in JDWP agent [v2]
Serguei Spitsyn
sspitsyn at openjdk.org
Mon Dec 22 23:14:55 UTC 2025
On Mon, 22 Dec 2025 20:31:55 GMT, Alex Menkov <amenkov at openjdk.org> wrote:
>> src/jdk.jdwp.agent/share/native/libjdwp/util.h line 64:
>>
>>> 62: /* To handle "format string is not a string literal" warning. */
>>> 63: #if !defined(_MSC_VER)
>>> 64: #define ATTRIBUTE_PRINTF(fmt, vargs) __attribute__((format(printf, fmt, vargs)))
>>
>> Why not ATTRIBUTE_FORMAT?
>
> printf is essential here, attribute(format) also support other functions - scanf, strftime, strfmon
Nit: The macro parameter names are confusing. I'd suggest to rename them to something like `fmt_pos_num` and `vargs_pos_num`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28937#discussion_r2641489071
More information about the serviceability-dev
mailing list