RFR: 8291633: Build failures with GCC 11, Alpine 3 due to incompatible casts from nullptr [v2]

Jie Fu jiefu at openjdk.org
Wed Aug 3 11:48:51 UTC 2022


On Wed, 3 Aug 2022 08:50:08 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Looks like GCC and musl that ship in new Alpine 3.15 highlight that some casts from `NULL` and `nullptr` are risky/illegal. 
>> 
>> They fall into three categories:
>>   - explicitly casting `NULL` to integral type; we can and should use `NULL_WORD` in these cases, like the rest of Hotspot does;
>>   - using `NULL` in ternary expression when another side is integral type, thus implicitly casting it;
>>   - `reinterpret_cast`-ing `NULL` to pointer type -- this is dangerous and rightfully breaks; we can use `static_cast` instead.
>> 
>> Additional testing:
>>  - [x] Linux x86_64 {release, fastdebug, slowdebug} build with Alpine 3.15, GCC 11.2.1
>>  - [x] Linux x86_64 fastdebug tier1 with GCC 9.3.0
>
> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Copyright years
>  - Merge branch 'master' into JDK-8291633-alpine3-nullptr
>  - More work
>  - Fix

Thanks for the update.
LGTM

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

Marked as reviewed by jiefu (Reviewer).

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


More information about the shenandoah-dev mailing list