RFR: 8292981: Unify and restructure integer printing format specifiers [v10]

Stefan Karlsson stefank at openjdk.org
Fri Sep 2 06:54:00 UTC 2022


On Thu, 1 Sep 2022 22:06:37 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix gtest compilation warning
>
> src/hotspot/share/cds/filemap.cpp line 1556:
> 
>> 1554:   if (size > 0) {
>> 1555:     log_info(cds)("Shared file region (%-3s)  %d: " SIZE_FORMAT_W(8)
>> 1556:                    " bytes, addr " INTPTR_FORMAT " file offset 0x%08" PRIxPTR
> 
> If not using one of our FORMAT macros for this one-off place, I think
> "0x%08zx" is shorter and at least as understandable as using of one of the PRI
> macros (whose meanings I can never remember, and whose very existence I tend
> to forget, but maybe that's just me).
> 
> But really, I wonder what the point of the field width is here?  Why isn't
> this just SIZE_FORMAT_X?
> 
> Alternatively, maybe SIZE_FORMAT_X_W should be SIZE_FORMAT_X_0_W?

I'm going to take the safer route and not poke around to much in this code. I've inlined the code verbatim, and I'll leave these questions for @iklam, in case he wants to clean this up in the feature.

-------------

PR: https://git.openjdk.org/jdk/pull/10042


More information about the hotspot-dev mailing list