RFR: 8337416: Fix -Wzero-as-null-pointer-constant warnings in misc. runtime code

Kim Barrett kbarrett at openjdk.org
Tue Jul 30 07:27:37 UTC 2024


On Tue, 30 Jul 2024 04:32:09 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Please review this (perhaps trivial?) change that removes some uses of literal
>> 0 as a null pointer constant in misc. runtime code.  Most are changed to use
>> nullptr. 
>> 
>> Testing: mach5 tier1
>
> This looks fine, and I think trivial.
> 
> I think there is an existing bug but probably better to file a separate JBS issue for that.
> 
> Thanks

Thanks for reviews @dholmes-ora and @TheShermanTanker .

I'll file a followup bug for the pre-existing fflush argument that @dholmes-ora pointed out.

> src/hotspot/share/oops/constantPool.cpp line 2068:
> 
>> 2066:   }
>> 2067:   printf("Cpool size: %d\n", size);
>> 2068:   fflush(nullptr);
> 
> This looks like a bug. I think someone used 0 aka fd0 when they needed stdout for fflush.

I assumed there was some reason for flushing all here, but you are right, this is probably a bug.

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

PR Comment: https://git.openjdk.org/jdk/pull/20383#issuecomment-2257653298
PR Review Comment: https://git.openjdk.org/jdk/pull/20383#discussion_r1696447458


More information about the hotspot-dev mailing list